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 purpose of sprintf?
What does void main () mean?
What is hungarian notation? Is it worthwhile?
Dont ansi function prototypes render lint obsolete?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Why main is used in c?
When the macros gets expanded?
How can this be legal c?
What is the difference between formatted&unformatted i/o functions?
What is assert and when would I use it?
How many bytes is a struct in c?
What is void main ()?
What is null in c?
How many levels of pointers can you have?
What is equivalent to ++i+++j?