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

Why c is known as a mother language?

642


What is bash c?

555


Tell me what is the purpose of 'register' keyword in c language?

614


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1857


What is null character in c?

688






What is the translation phases used in c language?

631


What is return in c programming?

512


What 'lex' does?

714


How a string is stored in c?

587


Write a program to show the change in position of a cursor using c

578


Tell us two differences between new () and malloc ()?

612


What is #include in c?

598


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2025


What is a global variable in c?

587


Difference between strcpy() and memcpy() function?

675