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 / lalit suthar, nilod

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

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

void main()
{
int a[5],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);

getch();
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is character constants?

1233


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3384


What is the difference between new and malloc functions?

1185


what is the basis for selection of arrays or pointers as data structure in a program

4345


Explain logical errors? Compare with syntax errors.

1128


What is non linear data structure in c?

1076


Explain 'far' and 'near' pointers in c.

1190


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1313


What does %d do?

1360


Whats s or c mean?

1087


What does %p mean?

1158


How can I call fortran?

1103


What is struct node in c?

1129


What is the mean of function?

1196


Are there namespaces in c?

1192