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
What is the purpose of type declarations?
what do u mean by Direct access files? then can u explain about Direct Access Files?
What is character set?
In a switch statement, what will happen if a break statement is omitted?
Explain what happens if you free a pointer twice?
Which built-in library function can be used to match a patter from the string?
What is the difference between a string and an array?
What is an identifier?
What is include directive in c?
Write a program to print all permutations of a given string.
What are the basic data types associated with c?
Is it better to bitshift a value than to multiply by 2?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Are comments included during the compilation stage and placed in the EXE file as well?
What is the use of typedef in structure in c?