C program to print the sum of all numbers in a given array
kw.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
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
The addition of a given array is 261
kodingwindow@kw:~$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.