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 are global variables?

1195


Why is event driven programming or procedural programming, better within specific scenario?

2437


How can I find out the size of a file, prior to reading it in?

1179


write a programming in c to find the sum of all elements in an array through function.

2180


Why is struct padding needed?

1089


can we have joblib in a proc ?

2310


What is the difference between far and near in c?

1071


Why static variable is used in c?

1037


Explain what is the benefit of using const for declaring constants?

1038


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1121


What is getch() function?

1069


Explain how can you determine the size of an allocated portion of memory?

1116


What is array in c with example?

1270


What are the __date__ and __time__ preprocessor commands?

1119


Explain is it valid to address one element beyond the end of an array?

1218