Write a C- program to display sum of no. from 1 to 10

#include<stdio.h>
#include<conio.h>
void main( )
{
int  no ,sum=0;
for(no=1;no<=10;no++)
{
sum = sum+no;
}
printf("Total = %d",sum);
getch();
}

2 comments:

  1. To get many examples of "c programming " visit http://www.cprogramming-bd.com/c_page1.aspx#c%20programming

    ReplyDelete

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number