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
What is the explanation for prototype function in c?
What is the difference between volatile and const volatile?
What is an lvalue?
Explain goto?
Which programming language is best for getting job 2020?
Write a program to swap two numbers without using the third variable?
What is a built-in function in C?
Calculate 1*2*3*____*n using recursive function??
What is a header file?
Define C in your own Language.
Write a program to check whether a number is prime or not using c?
Explain how do you search data in a data file using random access method?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
Difference between strcpy() and memcpy() function?
Write a C program to count the number of email on text