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