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
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Explain which function in c can be used to append a string to another string?
What are the different types of C instructions?
Explain what is a 'locale'?
What is cohesion and coupling in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
Why header file is used in c?
What is the use of function overloading in C?
What are the uses of null pointers?
Explain how can a program be made to print the name of a source file where an error occurs?
Why does everyone say not to use gets?
What are the functions to open and close file in c language?
What is array in C
Explain what math functions are available for integers? For floating point?
Why use int main instead of void main?