write a program to find the sum of the array elements in c
language?
Answer Posted / bishmeet singh
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,sum=0;
clrscr();
printf("enter the 5 elements to sum");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
sum=sum+a[i];
}
printf("sum of the elements is %d",sum);
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is c system32 taskhostw exe?
What is unary operator?
What is array in C
Explain two-dimensional array.
why return type of main is not necessary in linux
What is string in c language?
What do you mean by invalid pointer arithmetic?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
What is the use of in c?
What are the uses of null pointers?
Is c dynamically typed?
Write a program to reverse a linked list in c.
Explain how do you print an address?
What is the size of empty structure in c?
Explain the difference between the local variable and global variable in c?