write a program to find the sum of the array elements in c
language?
Answer Posted / aisha
#include<Stdio.h>
void main()
{
int sum=0,a[10],i,n;
printf("enter value of n");
scanf("%d",&n);
printf("enter array elements");
for(i=o;i<=n;;i++)
scanf("%d",&a[i]);
for(i=0;i<=n;i++)
{
sum= sum+a[i];
}
printf("sum of all array elements = %d",sum);
}
| Is This Answer Correct ? | 11 Yes | 5 No |
Post New Answer View All Answers
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
Can we change the value of #define in c?
Write a program to print “hello world” without using semicolon?
formula to convert 2500mmh2o into m3/hr
Write a program for Overriding.
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
difference between object file and executable file
What is a structure member in c?
Is javascript written in c?
What is array in c with example?
Explain what is the difference between functions getch() and getche()?
What is %lu in c?
How can I call a function with an argument list built up at run time?
please send me the code for multiplying sparse matrix using c
What are void pointers in c?