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 do you define a function?

1079


What are the features of c languages?

1140


What is masking?

1214


What are external variables in c?

1168


Explain the use of function toupper() with and example code?

1172


Write a program to show the change in position of a cursor using c

1125


Are local variables initialized to zero by default in c?

1100


When should the register modifier be used? Does it really help?

1009


Why is sizeof () an operator and not a function?

1091


program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)

2148


write a program in c language to print your bio-data on the screen by using functions.

6840


What is pass by value in c?

1135


What functions are used in dynamic memory allocation in c?

1122


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

2001


Why clrscr is used after variable declaration?

1763