Thursday, 9 April 2020

Program: print first 10 natural numbers & their sum

#include<stdio.h>
#include<conio.h>
void main()
{
int i,sum=0;
clrscr();
for(i=1;i<=10;i++)
{
printf(“%d no is= %d\n”,i,I);
sum=sum+i;
}
printf(“sum =%d”,sum);
getch();
}

No comments:

Post a Comment