write a program to find the sum of the array elements in c
language?
Answer Posted / vijay
#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 ? | 27 Yes | 17 No |
Post New Answer View All Answers
Explain what is a program flowchart and explain how does it help in writing a program?
Do you have any idea how to compare array with pointer in c?
Can you mix old-style and new-style function syntax?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is merge sort in c?
What is wrong in this statement?
What are global variables and explain how do you declare them?
What is the purpose of & in scanf?
What is include directive in c?
What is the best style for code layout in c?
what are the advantages of a macro over a function?
What the advantages of using Unions?
Difference between malloc() and calloc() function?
What is context in c?