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
What is the difference between array and pointer in c?
How is actual parameter different from the formal parameter?
what is the format specifier for printing a pointer value?
Why is a semicolon (;) put at the end of every program statement?
What does typeof return in c?
What is sorting in c plus plus?
What is the symbol indicated the c-preprocessor?
What is a spanning Tree?
Write programs for String Reversal & Palindrome check
Why pointers are used in c?
How can I get back to the interactive keyboard if stdin is redirected?
c language interview questions & answer
What is indirection in c?
What is the advantage of an array over individual variables?
How can I call a function with an argument list built up at run time?