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

what will be the output of the following program, justify?
#define TEST

int TEST getdata()
{
static i;
i+=10;
return i;

}

main()
{
int k;
k = getdata();
}


Answer Posted / rkr

The Static variable is initialized to zero
In the above program

static i; which is equivalent to static i = 0;
Next line i is incrementing by 10, then i value is 10.
return the value is 10

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of a conditional inclusion statement in C?

1059


Explain how are portions of a program disabled in demo versions?

1118


What are the types of data files?

1197


What is 'bus error'?

1144


What is build process in c?

1147


How are structure passing and returning implemented?

1032


What is struct node in c?

1073


What are static variables in c?

1078


Differentiate call by value and call by reference?

960


Explain why c is faster than c++?

1066


Do array subscripts always start with zero?

1296


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1217


Can we access the array using a pointer in c language?

1046


application attempts to perform an operation?

1969


What is huge pointer in c?

1082