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

#include<Stdio.h>
void main()
{
int sum=0,a[10],i,n;
printf("enter value of n");
scanf("%d",&n);
printf("enter array elements");
for(i=o;i<=n;;i++)
scanf("%d",&a[i]);
for(i=0;i<=n;i++)
{
sum= sum+a[i];
}
printf("sum of all array elements = %d",sum);
}

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2017


Can we change the value of #define in c?

956


Write a program to print “hello world” without using semicolon?

1076


formula to convert 2500mmh2o into m3/hr

941


Write a program for Overriding.

1118


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1808


difference between object file and executable file

6640


What is a structure member in c?

955


Is javascript written in c?

1014


What is array in c with example?

1163


Explain what is the difference between functions getch() and getche()?

987


What is %lu in c?

1175


How can I call a function with an argument list built up at run time?

1172


please send me the code for multiplying sparse matrix using c

2119


What are void pointers in c?

962