COMPUTER PROGRAMMING
Pages
Home
Showing posts with label
Sum Of Array
.
Show all posts
Showing posts with label
Sum Of Array
.
Show all posts
Sunday, 7 July 2013
SUM OF ARRAY
#include<stdio.h>
void main()
{
int a[100],i,n,sum=0;
printf("\n Enter the limit :");
scanf("%d",&n);
printf("\nEnter the %d Numbers.....\n",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
sum+=a[i];
}
printf("\nThe sum is %d :",sum);
}
Read more »
Older Posts
Home
Subscribe to:
Posts (Atom)