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
Write program to remove duplicate in an array?
When we use void main and int main?
Explain how can I prevent another program from modifying part of a file that I am modifying?
What is const and volatile in c?
What is #line in c?
Explain what are the __date__ and __time__ preprocessor commands?
What is the value of uninitialized variable in c?
What are qualifiers and modifiers c?
What is the use of putchar function?
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);
What is preprocessor with example?
What is 2c dna?
Why is c called a structured programming language?
How do you use a 'Local Block'?
how many key words availabel in c a) 28 b) 31 c) 32