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 is a const pointer?
What is p in text message?
can anyone suggest some site name..where i can get some good data structure puzzles???
When is a “switch” statement preferable over an “if” statement?
Suggesting that there can be 62 seconds in a minute?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
how to find binary of number?
What is spaghetti programming?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
Does sprintf put null character?
If fflush wont work, what can I use to flush input?
What is difference between far and near pointers?
What are valid operations on pointers?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.