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 / syed shoaib

#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,b=0;
printf("Enter the array elements\n");
for (i=0; i<5; i++)
scanf("%d",&a[i]);
for (i=0; i<5; i++)
{
b=b+a[i];
}
printf("Sum of array elements is %d",b);
}

Is This Answer Correct ?    19 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default value of local and global variables in c?

1047


What is function definition in c?

1077


How do we make a global variable accessible across files? Explain the extern keyword?

1884


What are header files and what are its uses in C programming?

1241


What are the uses of a pointer?

1151


What does volatile do?

981


What is the difference between printf and scanf )?

1098


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2223


Who invented bcpl language?

1198


What is 'bus error'?

1155


How can you find the exact size of a data type in c?

1005


Write a program to generate random numbers in c?

1101


How are Structure passing and returning implemented by the complier?

1170


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1059


What is #error and use of it?

1285