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


Please Help Members By Posting Answers For Below Questions

Which header file should you include if you are to develop a function which can accept variable number of arguments?

795


What is dynamic variable in c?

557


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

1580


Write a program which returns the first non repetitive character in the string?

590


How to write a code for reverse of string without using string functions?

1572






How to compare array with pointer in c?

610


What is dynamic dispatch in c++?

552


Why we write conio h in c?

550


What are types of structure?

598


what does static variable mean?

643


What is #line in c?

554


Why is c called "mother" language?

849


What is include directive in c?

635


How can I delete a file?

621


What is main () in c?

580