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
What are the two types of functions in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is a protocol in c?
How many levels deep can include files be nested?
Which built-in library function can be used to match a patter from the string?
Is c pass by value or reference?
Are there any problems with performing mathematical operations on different variable types?
What is the newline escape sequence?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Why c is known as a mother language?
What are types of structure?
What is %d used for?
write a c program for swapping two strings using pointer
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
How do we open a binary file in Read/Write mode in C?