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


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using enum to declare a constant?

588


Why do we need a structure?

590


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1444


Which is more efficient, a switch statement or an if else chain?

583


Do you know the purpose of 'register' keyword?

642






What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1492


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1699


What is the difference between near, far and huge pointers?

628


What is a c token and types of c tokens?

591


What are the valid places to have keyword “break”?

651


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1582


How many types of operator or there in c?

603


What is variable and explain rules to declare variable in c?

555


What is dangling pointer in c?

625


What does nil mean in c?

672