write a program to find the sum of the array elements in c
language?
Answer Posted / karnik ankit
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
printf("\n enter an elements in array");
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
printf("\n sum is %d",sum);
}
| Is This Answer Correct ? | 40 Yes | 20 No |
Post New Answer View All Answers
What is difference between static and global variable in c?
Is it possible to execute code even after the program exits the main() function?
Can I initialize unions?
Add Two Numbers Without Using the Addition Operator
write a program for the normal snake games find in most of the mobiles.
How do you search data in a data file using random access method?
Differentiate between null and void pointers.
What is "Duff's Device"?
What is spark map function?
What is a keyword?
What is a global variable in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What does int main () mean?
What is typedef example?
How can I make sure that my program is the only one accessing a file?