write a program to find the sum of the array elements in c
language?
Answer Posted / anuja kulkarni
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,sum=0;
clrscr();
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
// sum of array elements
for (i=0; i<5; i++)
{
sum=sum+a[i];
}
printf("Sum of array elements===%d",sum);
} // end of main()
Is This Answer Correct ? | 295 Yes | 71 No |
Post New Answer View All Answers
Can i use “int” data type to store the value 32768? Why?
Can you write the algorithm for Queue?
What are local static variables?
What is ## preprocessor operator in c?
What does sizeof int return?
Write a Program to accept different goods with the number, price and date of purchase and display them
Differentiate between full, complete & perfect binary trees.
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What is the use of volatile?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
Explain what are run-time errors?
What is #include cctype?
What is the usage of the pointer in c?
How can I delete a file?
What is adt in c programming?