Friday, August 19, 2011

Program to calculate the sum of all elements of array.


//Program to calculate the sum of all elements of array.
#include<stdio.h>
#include<conio.h>
void main()
{
 int a[10],i,sum=0;
 clrscr();
 printf(" enter the values of elements");
 for(i=0;i<10;i++)
 {
   scanf("%d",&a[i]);
   sum=sum+a[i];
 }
 printf("\n sum of values of array %d",sum);
 getch();
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More