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


Please Help Members By Posting Answers For Below Questions

Explain how can you be sure that a program follows the ansi c standard?

857


What is strcpy() function?

654


Why is #define used?

788


What are pointers in C? Give an example where to illustrate their significance.

747


What is #define size in c?

641






What are runtime error?

624


Is it possible to pass an entire structure to functions?

551


What is the use of void pointer and null pointer in c language?

624


What is a structure and why it is used?

618


How can you increase the allowable number of simultaneously open files?

593


What is the purpose of 'register' keyword in c language?

627


Explain what is the difference between text files and binary files?

612


What do you mean by c?

586


Write a program to print factorial of given number using recursion?

601


How can I make it pause before closing the program output window?

577