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 / heemashree

#include "stdio.h"
#include "conio.h"
#include "stdafx.h"
void main()
{
int a[10];
int i,sum=0,n;

printf("enter number of elements");
scanf("%d",&n);



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

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

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how we can make 3d venturing graphics on outer interface

4815


What does %p mean c?

1061


How many identifiers are there in c?

1013


What is clrscr in c?

1128


How can a program be made to print the name of a source file where an error occurs?

1214


provide an example of the Group by clause, when would you use this clause

2184


What is include directive in c?

1147


how to capitalise first letter of each word in a given string?

1921


what is the diffrenet bettwen HTTP and internet protocol

1832


What is indirection?

1082


What is operator precedence?

1195


can anyone suggest some site name..where i can get some good data structure puzzles???

2082


Write a program with dynamically allocation of variable.

1118


What does the error message "DGROUP exceeds 64K" mean?

1215


What is the difference between printf and scanf )?

1086