write a program to find the sum of the array elements in c
language?

Answer Posted / vaibhav

#include<stdio.h>
#include<conio.h>
void main()
{
int n[5],sum=0,i=0;
clrscr();
for(i=0;i<4;i++)
{
scanf("%d",&n[i]);
}

for(i=0;i<4;i++)
{
sum=sum+n[i];
}
printf("sum are%d",sum);
getch();
}

Is This Answer Correct ?    72 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write program to remove duplicate in an array?

595


When we use void main and int main?

582


Explain how can I prevent another program from modifying part of a file that I am modifying?

630


What is const and volatile in c?

561


What is #line in c?

554






Explain what are the __date__ and __time__ preprocessor commands?

584


What is the value of uninitialized variable in c?

562


What are qualifiers and modifiers c?

540


What is the use of putchar function?

646


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

639


What is preprocessor with example?

575


What is 2c dna?

598


Why is c called a structured programming language?

671


How do you use a 'Local Block'?

714


how many key words availabel in c a) 28 b) 31 c) 32

627