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
What are the types of variables in c?
What is the use of structure padding in c?
What are the advantages and disadvantages of pointers?
What does sizeof int return?
How can you find the day of the week given the date?
What is a memory leak? How to avoid it?
Which is the memory area not included in C program? give the reason
What is 1d array in c?
What does != Mean in c?
Explain the difference between malloc() and calloc() function?
What are the storage classes in C?
Why header file is used in c?
How can I insert or delete a line (or record) in the middle of a file?
What is sizeof int?
What are examples of structures?