Pages

Saturday, 19 May 2012

program to print Ten Numbers and find out its Total


40./*Write a program to print Ten Numbers and find out its Total*/

#include<stdio.h>
#include<conio.h>
main()
{
int i,num;
int sum=0;
clrscr();
printf("\nEnter Ten Numbers:");
for(i=0;i<10;i++)
{
scanf("%d",&num);
sum=sum+num;
}
printf("\n The Sum of Entered Numbers is:%d",sum);
getch();
}


OUTPUT
            Enter Ten Numbers:11 21 31 41 51 61 71 81 91 101
            The Sum of Entered Number is:560

No comments:

Post a Comment