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 is the output of the below program and how it is?

void main()
{
static int var=5;
printf("%d",var--);
if(var)
main();
}

Answer Posted / thiyagu

since the value of var is declared as static
the output will be 4 for each time printf is called by
recursive method main().

Is This Answer Correct ?    5 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are multidimensional arrays?

1015


Explain what are the __date__ and __time__ preprocessor commands?

1083


What is an lvalue?

1024


Under what circumstances does a name clash occur?

1164


What is the difference between variable declaration and variable definition in c?

1025


Why enum is used in c?

905


What is difference between arrays and pointers?

1024


Are the expressions * ptr ++ and ++ * ptr same?

1094


What is character constants?

1140


What is d'n in c?

1080


write a c program for swapping two strings using pointer

2578


What is c mainly used for?

1008


What is output redirection?

1175


Is printf a keyword?

1164


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1129