write a program to find the sum of the array elements in c
language?
Answer Posted / mathews m
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,x[20];
clrscr();
printf("enter the array space");
scanf("%d",&n);
printf("enter the elements");
for(i=0;i<n;i++)
scanf("%d"&x[i]);
for(i=0;i<n;i++)
{
sum=sum+x[i];
}
printf("the sum of elements in an array=%d");
}
getch();
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Explain the use of keyword 'register' with respect to variables.
Should I learn data structures in c or python?
How does placing some code lines between the comment symbol help in debugging the code?
When the macros gets expanded?
What was noalias and what ever happened to it?
Give the rules for variable declaration?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Write a program to find factorial of a number using recursive function.
What does %c mean in c?
p*=(++q)++*--p when p=q=1 while(q<=6)
How do I read the arrow keys? What about function keys?
Explain the difference between null pointer and void pointer.
What is difference between structure and union in c programming?
What is return type in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year