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...


#include<stdio.h>
int SumElement(int *,int);
void main(void)
{
int x[10];
int i=10;
for(;i;)
{
i--;
*(x+i)=i;

}
printf("%d",SumElement(x,10));
}
int SumElement(int array[],int size)
{
int i=0;
float sum=0;
for(;i<size;i++)
sum+=array[i];
return sum;
}

output?

Answer Posted / madhu

Ans is 45.
for(exp1;exp2;exp3)
So the 2nd expression when once it becomes 0 control comes
out of for loop and executes the funtion which gives the
answer as 45
0+1+2+3+4+5+6+7+8+9

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to print "hello world" without using a semicolon?

1065


When can a far pointer be used?

1027


What is the role of this pointer?

1075


How do you convert strings to numbers in C?

1230


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

1052


How old is c programming language?

1012


I came across some code that puts a (void) cast before each call to printf. Why?

1220


Do pointers store the address of value or the actual value of a variable?

1082


What is scanf_s in c?

1125


Explain what math functions are available for integers? For floating point?

1116


Explain a file operation in C with an example.

1121


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1255


How will you write a code for accessing the length of an array without assigning it to another variable?

1050


How can I determine whether a machines byte order is big-endian or little-endian?

1065


what is the function of pragma directive in c?

1125