Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / anuja kulkarni

#include<stdio.h>
#include<conio.h>

void main()
{
int a[5];
int i,sum=0;

clrscr();
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);

// sum of array elements
for (i=0; i<5; i++)
{
sum=sum+a[i];
}
printf("Sum of array elements===%d",sum);
} // end of main()

Is This Answer Correct ?    295 Yes 71 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write c functions that modify head pointer of a linked list?

992


What does sizeof function do?

1195


Who is the main contributor in designing the c language after dennis ritchie?

1003


Which is better oop or procedural?

1067


Why array is used in c?

1016


Is r written in c?

1157


Why clrscr is used after variable declaration?

1689


How do you declare a variable that will hold string values?

1179


C language questions for civil engineering

1720


Why we not create function inside function.

2193


What is the difference between pure virtual function and virtual function?

1122


There seem to be a few missing operators ..

1048


What do you mean by Recursion Function?

1124


Write programs for String Reversal & Palindrome check

1061


List the different types of c tokens?

1074