C Program to calculate sum of array elements in C

C Program to calculate sum of array elements in C




#include
#include
void main(){
int array[5]={4,8,9,13,25};
int i,sum=0;
for(i=0;i<5;i++){
sum=sum+array[i];
}
printf("Sum of Array is %d ",sum);
getch();
}


1 comment:

  1. how to print given string s[]="ramu,160,198",
    like ramu
    160
    190 with line by line? mail me devyareddy@gmail.com

    ReplyDelete