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
Describe static function with its usage?
Do character constants represent numerical values?
What is the use of static variable in c?
What is pointer to pointer in c with example?
How can you tell whether two strings are the same?
How do you define CONSTANT in C?
What is the difference between %d and %i?
What are qualifiers in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Explain what is the benefit of using an enum rather than a #define constant?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
How can you draw circles in C?
Why do we need volatile in c?
What is c value paradox explain?