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
Is null always equal to 0(zero)?
Define and explain about ! Operator?
What is abstract data structure in c?
What is C language ?
Explain what happens if you free a pointer twice?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Are enumerations really portable?
Explain what is a stream?
What are header files why are they important?
What are the types of data types and explain?
Write a program to print factorial of given number without using recursion?
Should I learn data structures in c or python?
Why should I use standard library functions instead of writing my own?
What is ## preprocessor operator in c?
What is the Purpose of 'extern' keyword in a function declaration?