Tuesday, September 7, 2010

Find out sum of 10 numbers

#include"stdio.h"
#include"conio.h"
void main()
{

 int i,n=10,a,sum=0;

 printf("Enter 10 Number Values:\n");
 for(i=1;i<=n;i++)
 {
  scanf("%d",&a);
  sum=sum+a;
 }
 printf("\nSum of 10 Number is= %d",sum);
 getch();

}

No comments: