All Data For Free
Pages
Home
Watch Full WWE Episodes of Raw and Smackdown
Contact Us
Copyright Policy
Sunday, 11 December 2011
Write a program to print the triangle value in c
#include
#include
main()
{
int n,sum=0;
clrscr();
printf("Enter any value");
scanf("%d",&n);
while(n>0)
{
sum=sum+n;
n--;
}
printf("Triangular value is %d",sum);
getch();
}
OUTPUT
Enter any value : 5
Triangular value is 15
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment