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
What is difference between array and pointer in c?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Can you please compare array with pointer?
What is formal argument?
what is a constant pointer in C
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?
Describe the header file and its usage in c programming?
write a c program for swapping two strings using pointer
The statement, int(*x[]) () what does in indicate?
When should volatile modifier be used?
Why main function is special give two reasons?
What’s the special use of UNIONS?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What is wrong with this statement? Myname = 'robin';