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
Explain how can you be sure that a program follows the ansi c standard?
What is strcpy() function?
Why is #define used?
What are pointers in C? Give an example where to illustrate their significance.
What is #define size in c?
What are runtime error?
Is it possible to pass an entire structure to functions?
What is the use of void pointer and null pointer in c language?
What is a structure and why it is used?
How can you increase the allowable number of simultaneously open files?
What is the purpose of 'register' keyword in c language?
Explain what is the difference between text files and binary files?
What do you mean by c?
Write a program to print factorial of given number using recursion?
How can I make it pause before closing the program output window?