write a program to find the sum of the array elements in c
language?
Answer Posted / karnik ankit
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
printf("\n enter an elements in array");
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
printf("\n sum is %d",sum);
}
| Is This Answer Correct ? | 40 Yes | 20 No |
Post New Answer View All Answers
How many levels of pointers can you have?
What is a class c rental property?
What are structure members?
When should the volatile modifier be used?
Explain how do you determine the length of a string value that was stored in a variable?
What should malloc(0) do?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Write a program to swap two numbers without using third variable?
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
Is exit(status) truly equivalent to returning the same status from main?
What is the difference between āgā and āgā in C?
What is meant by recursion?
What are data types in c language?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Define the scope of static variables.