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

Why is extern used in c?

1059


How can I discover how many arguments a function was actually called with?

1030


How can you pass an array to a function by value?

1065


How can a program be made to print the line number where an error occurs?

1043


Why shouldn’t I start variable names with underscores?

1018


What is the c value paradox and how is it explained?

1002


How can I write a function analogous to scanf?

1111


What is an arrays?

1037


What does s c mean on snapchat?

1051


What is nested structure in c?

1027


What are header files why are they important?

1053


Is c weakly typed?

974


How can you read a directory in a C program?

1098


Why do we need a structure?

989


what is event driven software and what is procedural driven software?

2516