C# program to sum members of array

           C# program to sum members of Array


/*website: http://ankitcguru.blogspot.com/
*programmer:ankit gehlot*/

#include<stdio.h> 
#include<conio.h> 
void main() { 
int sum=0,i; 
int num[10];  
for(i=0;i<10;i++){ 
printf("enter value in array:"); 
scanf("%d",&num[i]); 
sum=sum+num[i]; } 
printf("sum of array:%d",sum); 
getch(); 
}

Output:-
 
enter value in array:1
enter value in array:2
enter value in array:3
enter value in array:4
enter value in array:5
enter value in array:6
enter value in array:7
enter value in array:8
enter value in array:9
enter value in array:10
sum of array:55

Comments

Popular posts from this blog