HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C program to Find Sum of all Elements in an Array ?


Q:- Write a C program to Find Sum of all Elements in an Array ?
            #include<stdio.h>
            #include<conio.h>
            main()
   {
int a[5],I,s=0;
clrscr();
printf(“Enter 5 Elements =”);
for(i=0;i<7;i++)
{
scanf(“%d”,&a[i]);
s=s+a[i];
}
printf(“Sum of all Elements =%d”,s);
getch();
      }