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

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

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between if else and switchstatement

1938


What is an endless loop?

1280


Is c pass by value or reference?

1043


what are the 10 different models of writing an addition program in C language?

1897


Explain what are bus errors, memory faults, and core dumps?

1283


Explain union. What are its advantages?

1081


When should the volatile modifier be used?

1189


How macro execution is faster than function ?

1200


Does c have an equivalent to pascals with statement?

1011


What is multidimensional arrays

1131


What is a lvalue

1087


Can 'this' pointer by used in the constructor?

1097


What is pointers in c?

1120


Tell me about low level programming languages.

1135


What does it mean when a pointer is used in an if statement?

1111