Sum of Ten numbers using array

C, C++, etc Programing examples. Post as many you can. Test the programs and discuss about the output of the programes.
Forum rules
Please Discuss & post only about the programes and its Output

Sum of Ten numbers using array

Postby kantisuthar » Sat Apr 16, 2011 2:59 pm

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10];
int i,total=0;
clrscr();
printf("\n\t Enter 10 integer values : " );
for(i=0;i<10;i++)
scanf("%d",&a[i]);
for(i=0;i<10;i++)
total=total+a[i];
printf("\n\t Total of 10 integers number are %d",total);
getch();
}
kantisuthar
Registered User
 
Posts: 6
Joined: Thu Apr 14, 2011 7:22 pm
membership: Associate Member of The Institution of Engineers (India)- AMIE

ad
 

Return to Computer Notes : Some Sample Programs

Who is online

Users browsing this forum: No registered users and 0 guests