write a program to find the sum of the array elements in c
language?
Answer Posted / m.sushma
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],sum=0,n,i;
printf("Enter range");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("The sum of all the elements in the given array
is\n");
for(i=0;i<n;i++)
sum=sum+a[i];
printf("%d",sum);
getch();
}
| Is This Answer Correct ? | 19 Yes | 15 No |
Post New Answer View All Answers
Is a house a shell structure?
What are integer variable, floating-point variable and character variable?
What are structure members?
What is a newline escape sequence?
How do you print an address?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is the difference between exit() and _exit() function?
What are the modifiers available in c programming language?
What does d mean?
How can I delete a file?
What are c identifiers?
Create a simple code fragment that will swap the values of two variables num1 and num2.
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
c program to compute AREA under integral