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

How do you define a string?

651


What is #include stdlib h?

614


Differentiate between static and dynamic modeling.

615


What is scope rule of function in c?

549


Does c have enums?

600






What is data structure in c and its types?

594


Write a program to swap two numbers without using third variable?

814


What are qualifiers?

615


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

702


What is volatile keyword in c?

582


Write a program to check palindrome number in c programming?

596


Tell me what is the purpose of 'register' keyword in c language?

614


write a c program for swapping two strings using pointer

2094


What is #ifdef ? What is its application?

644


When should we use pointers in a c program?

630