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 / mathews m

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0,x[20];
clrscr();
printf("enter the array space");
scanf("%d",&n);
printf("enter the elements");
for(i=0;i<n;i++)
scanf("%d"&x[i]);
for(i=0;i<n;i++)
{
sum=sum+x[i];
}
printf("the sum of elements in an array=%d");
}
getch();

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of keyword 'register' with respect to variables.

1103


Should I learn data structures in c or python?

1074


How does placing some code lines between the comment symbol help in debugging the code?

1066


When the macros gets expanded?

1490


What was noalias and what ever happened to it?

1100


Give the rules for variable declaration?

1223


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1167


Write a program to find factorial of a number using recursive function.

1182


What does %c mean in c?

1144


p*=(++q)++*--p when p=q=1 while(q<=6)

1821


How do I read the arrow keys? What about function keys?

1152


Explain the difference between null pointer and void pointer.

1134


What is difference between structure and union in c programming?

1178


What is return type in c?

1193


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3151