write a program to find the sum of the array elements in c
language?

Answer Posted / uday

#include<stdio.h>
void main()
{
int a[i],sum=0;
printf("enter n value");
scanf("%d",&n);
for(i=0;i<n,i++)
{
scanf("%d",&a[i])
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("sum=%d");
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why ca not I do something like this?

587


What are the advantages and disadvantages of a heap?

713


What is the difference between c and python?

586


Do string constants represent numerical values?

923


Are enumerations really portable?

596






what is uses of .net

1277


how to build a exercise findig min number of e heap with list imlemented?

1612


Are there constructors in c?

595


Explain how do you sort filenames in a directory?

608


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1593


What is omp_num_threads?

584


Is it possible to have a function as a parameter in another function?

599


How can you call a function, given its name as a string?

714


How can I remove the leading spaces from a string?

636


why return type of main is not necessary in linux

1706