Wap to calculate the sum of first 10 integer using Less than Equal to operator
/*write a c program to add first 10 successive int*/#include<stdio.h>#include<conio.h>void main()
{
int n,sum=0;
clrscr();
for(n=1;n<=10;n++)
{
sum=sum+n;
}
printf("sum of first 10 successive int:%d",sum);
getch();
}
No comments:
Post a Comment