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
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
What is the usage of the pointer in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
What are the different types of endless loops?
How can my program discover the complete pathname to the executable from which it was invoked?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Tell me when would you use a pointer to a function?
What is the difference between variable declaration and variable definition in c?
How to declare a variable?
What is the use of typedef in c?
Why is c so popular?
What is modifier & how many types of modifiers available in c?
What is meant by high-order and low-order bytes?
What is an identifier?
What are the application of void data type in c?