ShriRam Changed status to publish July 16, 2022
#include<stdio.h> #include<conio.h> int sum(int a[]); int sum(int a[]) { int k=0,i; for(i=0;i<5;i++) k=k+a[i]; return k; } main() { int b[5] = {1,2,3,4,5}; printf("%d",sum(b)); getch(); } ------------------ OR ---------------------------- #include #include int sum(int a[5]); int sum(int a[5]) { int k=0,i; for(i=0;i<5;i++) k=k+a[i]; return k; } main() { int b[5] = {1,2,3,4,5}; printf("%d",sum(b)); getch(); }
ShriRam Changed status to publish July 16, 2022