#include
main()
{
int n,i=1,sum=0;
clrscr();
printf("Enter any value");
scanf("%d",&n);
while(i<=n)
{
sum=sum+i;
printf("N Triangular of %d is %d\n",sum);
i++;
}
getch();
}
OUTPUT
Enter any value: 4
N Triangular of 1 is 2400
N Triangular of 3 is 2400
N Triangular of 6 is 2400
No comments:
Post a Comment