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
What are pointers?
What does c mean in standard form?
What is a c token and types of c tokens?
What is extern keyword in c?
When should the register modifier be used? Does it really help?
What is a macro?
Is main an identifier in c?
Does sprintf put null character?
What are the Advantages of using macro
Write a program of prime number using recursion.
What is a structural principle?
Define the scope of static variables.
What is #define in c?
What is a pointer on a pointer in c programming language?
Write a program for finding factorial of a number.