write a program to find the sum of the array elements in c
language?
Answer Posted / anuja kulkarni
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,sum=0;
clrscr();
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
// sum of array elements
for (i=0; i<5; i++)
{
sum=sum+a[i];
}
printf("Sum of array elements===%d",sum);
} // end of main()
| Is This Answer Correct ? | 295 Yes | 71 No |
Post New Answer View All Answers
How many levels of indirection in pointers can you have in a single declaration?
What is maximum size of array in c?
What is echo in c programming?
write a program for the normal snake games find in most of the mobiles.
When c language was developed?
What is the mean of function?
What is indirection in c?
What is the use of static variable in c?
What is n in c?
What are global variables and explain how do you declare them?
What is the difference between scanf and fscanf?
What is integer constants?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
What are the different types of data structures in c?
how can I convert a string to a number?