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

#include<stdio.h>
#include<conio.h>
void main()
{
int n[5],sum=0,i=0;
clrscr();
for(i=0;i<4;i++)
{
scanf("%d",&n[i]);
}

for(i=0;i<4;i++)
{
sum=sum+n[i];
}
printf("sum are%d",sum);
getch();
}

Is This Answer Correct ?    72 Yes 41 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between array and pointer in c?

1156


How is actual parameter different from the formal parameter?

1021


what is the format specifier for printing a pointer value?

1016


Why is a semicolon (;) put at the end of every program statement?

1069


What does typeof return in c?

1090


What is sorting in c plus plus?

972


What is the symbol indicated the c-preprocessor?

1240


What is a spanning Tree?

1579


Write programs for String Reversal & Palindrome check

1056


Why pointers are used in c?

1006


How can I get back to the interactive keyboard if stdin is redirected?

1185


c language interview questions & answer

1950


What is indirection in c?

1065


What is the advantage of an array over individual variables?

1227


How can I call a function with an argument list built up at run time?

1233