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


Please Help Members By Posting Answers For Below Questions

What is scope rule of function in c?

539


Can you please compare array with pointer?

607


What is volatile variable in c?

652


What is structure pointer in c?

565


What are data structures in c and how to use them?

662






What are the disadvantages of c language?

610


Why is c not oop?

533


What is the difference between local variable and global variable in c?

677


What is c token?

599


Tell me when would you use a pointer to a function?

598


What is a pointer variable in c language?

637


What is data type long in c?

617


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

646


What is "Duff's Device"?

695


Sir i need notes for structure,functions,pointers in c language can you help me please

1939