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

#include "stdio.h"
#include "conio.h"
#include "stdafx.h"
void main()
{
int a[10];
int i,sum=0,n;

printf("enter number of elements");
scanf("%d",&n);



printf("Enter the array elements\n");
for (i=0; i<n; i++)
scanf("%d",&a[i]);

// sum of array elements
for (i=0; i<n; i++)
{
sum=sum+a[i];
}
printf("Sum of array elements===%d",sum);
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

1055


How can I recover the file name given an open stream?

1082


What are the back slash character constants or escape sequence charactersavailable in c?

1233


What is the use of getchar functions?

1232


Why does the call char scanf work?

1261


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

2049


What is formal argument?

1191


Explain is it better to bitshift a value than to multiply by 2?

1250


What is a good way to implement complex numbers in c?

1091


Is there a way to jump out of a function or functions?

1165


int i=10; printf("%d %d %d", i, i=20, i);

1699


Write a C program in Fibonacci series.

1137


What are operators in c?

1077


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1264


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1158