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 / mohd hayyan

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

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

to find the closest pair

2326


How can I sort more data than will fit in memory?

1112


Why double pointer is used in c?

1043


What is a dynamic array in c?

1159


Differentiate abs() function from fabs() function.

1018


What does the && operator do in a program code?

1236


What is void c?

1082


How can I ensure that integer arithmetic doesnt overflow?

1171


how to find anagram without using string functions using only loops in c programming

3192


What is the function of this pointer?

1343


In a switch statement, explain what will happen if a break statement is omitted?

1076


What are the 4 types of functions?

1059


What is function in c with example?

1158


How is = symbol different from == symbol in c programming?

1049


List a few unconditional control statement in c.

988