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
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
Why main is used in c?
c language interview questions & answer
In c language can we compile a program without main() function?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Is array name a pointer?
What is n in c?
Explain the advantages of using macro in c language?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
What is the difference between int main and void main in c?
which is an algorithm for sorting in a growing Lexicographic order
What are types of structure?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
Why is it usually a bad idea to use gets()? Suggest a workaround.
Explain spaghetti programming?