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
What is hungarian notation? Is it worthwhile?
What are the rules for identifiers in c?
How are 16- and 32-bit numbers stored?
What are c identifiers?
Explain spaghetti programming?
What is data structure in c programming?
Do you know what are bitwise shift operators in c programming?
What is an array in c?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is getch () for?
what is the diffrenet bettwen HTTP and internet protocol
What is difference between main and void main?
explain what are actual arguments?
What is header file definition?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles