C Program to print sum of the natural numbers from 1 to 10
# include <stdio.h>
# include <conio.h>
main( )
{
int n,sum=0,i;
clrscr( );
for (i=1; i<=10; i++)
sum=sum+i;
printf(“sum of natural numbers from 1 to 10 is %d\n”,sum);
getch( );
}
The Way to Programming
The Way to Programming
C Program to print sum of the natural numbers from 1 to 10
# include <stdio.h>
# include <conio.h>
main( )
{
int n,sum=0,i;
clrscr( );
for (i=1; i<=10; i++)
sum=sum+i;
printf(“sum of natural numbers from 1 to 10 is %d\n”,sum);
getch( );
}
Sign in to your account