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


Please Help Members By Posting Answers For Below Questions

Can i use “int” data type to store the value 32768? Why?

747


Can you write the algorithm for Queue?

1544


What are local static variables?

612


What is ## preprocessor operator in c?

607


What does sizeof int return?

582






Write a Program to accept different goods with the number, price and date of purchase and display them

5427


Differentiate between full, complete & perfect binary trees.

664


Explain can the sizeof operator be used to tell the size of an array passed to a function?

586


What is the use of volatile?

602


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

1697


Explain what are run-time errors?

601


What is #include cctype?

570


What is the usage of the pointer in c?

596


How can I delete a file?

621


What is adt in c programming?

602