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

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0;
clrscr();
for(i=0;i<10;i++)
{
printf("\n enter an elements in array");
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
sum=sum+a[i];
}
printf("\n sum is %d",sum);
}

Is This Answer Correct ?    27 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a program flowchart and explain how does it help in writing a program?

1043


Do you have any idea how to compare array with pointer in c?

990


Can you mix old-style and new-style function syntax?

1048


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2401


Why is it usually a bad idea to use gets()? Suggest a workaround.

1689


What is merge sort in c?

1002


What is wrong in this statement?

1079


What are global variables and explain how do you declare them?

1030


What is the purpose of & in scanf?

1009


What is include directive in c?

1091


What is the best style for code layout in c?

1047


what are the advantages of a macro over a function?

1095


What the advantages of using Unions?

1163


Difference between malloc() and calloc() function?

1129


What is context in c?

883