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
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is the difference between %d and %i?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
How can a program be made to print the name of a source file where an error occurs?
Explain what are multidimensional arrays?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What is a union?
Explain how can type-insensitive macros be created?
what is the basis for selection of arrays or pointers as data structure in a program
What functions are used in dynamic memory allocation in c?
Using which language Test cases are added in .ptu file of RTRT unit testing???
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
How do you list a file’s date and time?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What does s c mean in text?