C program to print the sum of all numbers in a given array
gd.c
#include<stdio.h>intmain(){intsum=0;intarr[5]={100,15,8,45,93};for(inti=0;i<5;i++){sum=sum+arr[i];}printf("The addition of a given array is %d ",sum);return0;}
Output
godarda@gd:~$ gcc gd.c godarda@gd:~$ ./a.out
The addition of a given array is 261
godarda@gd:~$
Dear User, Thank you for visitng GoDarda. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.