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
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is bash c?
What is the use of getch ()?
Difference between macros and inline functions? Can a function be forced as inline?
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
Explain why can’t constant values be used to define an array’s initial size?
Write a program to print fibonacci series using recursion?
Differentiate between #include<...> and #include '...'
What are operators in c?
What are the Advantages of using macro
How do you use a 'Local Block'?
Write a program to reverse a linked list in c.
How can you draw circles in C?
What is function prototype in c language?
What is chain pointer in c?