write a program to find the sum of the array elements in c
language?

Answer Posted / vijay

#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 ?    27 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

621


What is assignment operator?

620


Explain is it valid to address one element beyond the end of an array?

724


What is string concatenation in c?

562


What are the advantage of c language?

544






What is pointer in c?

731


What is stack in c?

599


What does 2n 4c mean?

701


By using C language input a date into it and if it is right?

565


How can I insert or delete a line (or record) in the middle of a file?

566


Can you pass an entire structure to functions?

686


What is static and auto variables in c?

552


Can we initialize extern variable in c?

626


What is the advantage of a random access file?

633


What is %d used for?

578