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

"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

1103


What is the basic structure of c?

1086


What is meant by type casting?

1057


Where are local variables stored in c?

1048


What is the difference between char array and char pointer?

1062


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1239


What are comments and how do you insert it in a C program?

1254


What is structure in c language?

1177


i got 75% in all semester am i eligible for your company

2230


What are dangling pointers in c?

1239


Explain what is wrong with this statement? Myname = ?robin?;

1590


Is there any possibility to create customized header file with c programming language?

1066


Explain what is the difference between text files and binary files?

1161


Simplify the program segment if X = B then C ← true else C ← false

3021


Is c dynamically typed?

1165