write a program to find the sum of the array elements in c
language?
Answer Posted / mohd hayyan
#include<stdio.h>
#include<conio.h>
void main()
{
int a[i],i,sum=0;
clrscr();
printf("enter the array");
for(i=0;i<3;i++)
scanf("%d",&a[i]);
for(i=0;i<3;i++)
{
sum=sum+a[i];
}
for(i=0;i<3;i++)
{
printf("a[%d]=%d",i,a[i]);
}
printf("%d",sum);
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
to find the closest pair
How can I sort more data than will fit in memory?
Why double pointer is used in c?
What is a dynamic array in c?
Differentiate abs() function from fabs() function.
What does the && operator do in a program code?
What is void c?
How can I ensure that integer arithmetic doesnt overflow?
how to find anagram without using string functions using only loops in c programming
What is the function of this pointer?
In a switch statement, explain what will happen if a break statement is omitted?
What are the 4 types of functions?
What is function in c with example?
How is = symbol different from == symbol in c programming?
List a few unconditional control statement in c.