write a program to find the sum of the array elements in c
language?
Answer Posted / syed shoaib
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,b=0;
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
for (i=0; i<5; i++)
{
b=b+a[i];
}
printf("Sum of array elements is %d",b);
}
Is This Answer Correct ? | 19 Yes | 13 No |
Post New Answer View All Answers
What is scope rule of function in c?
Can you please compare array with pointer?
What is volatile variable in c?
What is structure pointer in c?
What are data structures in c and how to use them?
What are the disadvantages of c language?
Why is c not oop?
What is the difference between local variable and global variable in c?
What is c token?
Tell me when would you use a pointer to a function?
What is a pointer variable in c language?
What is data type long in c?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What is "Duff's Device"?
Sir i need notes for structure,functions,pointers in c language can you help me please