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
Why c is known as a mother language?
What is bash c?
Tell me what is the purpose of 'register' keyword in c language?
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(); }
What is null character in c?
What is the translation phases used in c language?
What is return in c programming?
What 'lex' does?
How a string is stored in c?
Write a program to show the change in position of a cursor using c
Tell us two differences between new () and malloc ()?
What is #include in c?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is a global variable in c?
Difference between strcpy() and memcpy() function?