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 / m.sushma

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],sum=0,n,i;
printf("Enter range");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("The sum of all the elements in the given array
is\n");
for(i=0;i<n;i++)
sum=sum+a[i];
printf("%d",sum);
getch();
}

Is This Answer Correct ?    19 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where we use clrscr in c?

1117


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1702


Explain how can you be sure that a program follows the ansi c standard?

1448


Can a program have two main functions?

1106


what are the advantages of a macro over a function?

1131


Explain what are its uses in c programming?

1042


What are the functions to open and close the file in c language?

1020


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1213


What is the use of static variable in c?

1078


write a program to rearrange the array such way that all even elements should come first and next come odd

2261


Is there a way to compare two structure variables?

1097


What is wrong with this statement? Myname = 'robin';

1312


What are the general description for loop statement and available loop types in c?

1101


What is a #include preprocessor?

1124


What is structure packing in c?

1064




-->