write a program to find the sum of the array elements in c
language?
Answer Posted / madhura musale
#include<stdio.h>
#include<conio.h>
void main()
{
int i,a[10],sum;
clrscr();
printf("\n Enter the elements in an array :");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("\n The sum of elements of an array are :");
for((i=0;i<10;i++)
sum=sum+a[i];
printf("\t %d",sum);
getch();
}
| Is This Answer Correct ? | 25 Yes | 26 No |
Post New Answer View All Answers
Why header file is used in c?
What are the types of assignment statements?
How we can insert comments in a c program?
Explain what is meant by high-order and low-order bytes?
What is the purpose of void in c?
Can we use any name in place of argv and argc as command line arguments?
Can you write the function prototype, definition and mention the other requirements.
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Why do we use main function?
What is a method in c?
What is structure padding and packing in c?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What is main return c?
Write a program to find factorial of a number using recursive function.
What are the data types present in c?