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
What is the default value of local and global variables in c?
What is function definition in c?
How do we make a global variable accessible across files? Explain the extern keyword?
What are header files and what are its uses in C programming?
What are the uses of a pointer?
What does volatile do?
What is the difference between printf and scanf )?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
Who invented bcpl language?
What is 'bus error'?
How can you find the exact size of a data type in c?
Write a program to generate random numbers in c?
How are Structure passing and returning implemented by the complier?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
What is #error and use of it?