write a program to find the sum of the array elements in c
language?
Answer Posted / rajkumar
//c program of sum array element
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,n,a[100];
clrscr();
printf("How many number are you entering(less than 100) ?");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
//sum of array element
for(i=1;i<=n;i++)
{
sum=sum+a[i];
}
printf("Sum of your entered number is=%d",sum);
getch();
}//End of main
Is This Answer Correct ? | 24 Yes | 9 No |
Post New Answer View All Answers
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What is dynamic variable in c?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
Write a program which returns the first non repetitive character in the string?
How to write a code for reverse of string without using string functions?
How to compare array with pointer in c?
What is dynamic dispatch in c++?
Why we write conio h in c?
What are types of structure?
what does static variable mean?
What is #line in c?
Why is c called "mother" language?
What is include directive in c?
How can I delete a file?
What is main () in c?