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 / bishmeet singh

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,n,sum=0;
printf("enter the no. of elements");
back:
scanf("%d",&n);
if(n<10)
{
printf("elements sholud be less than 10\n enter again");
goto back;
}
printf("Enter %d elements",n);
for(i=0;i<n;i++)
{
scanf("%d",a[i]);
sum=sum+a[i];
}

printf("sum of your entered elements is %d",sum);
getch();
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What functions are used in dynamic memory allocation in c?

1085


Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

2080


What are the string functions? List some string functions available in c.

991


how to introdu5ce my self in serco

2007


What standard functions are available to manipulate strings?

1155


Explain indirection?

1142


How to establish connection with oracle database software from c language?

2203


What is page thrashing?

1083


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1251


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1145


Is void a keyword in c?

986


What does 3 mean in texting?

1100


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1283


please give me some tips for the placement in the TCS.

2114


What are the 4 types of unions?

1041