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

What is the sizeof () operator?

1086


How can you draw circles in C?

1156


What is the difference between scanf and fscanf?

1268


please explain every phase in the "SDLC" in the dotnet.

2619


What are local static variables? How can you use them?

1148


What is printf () in c?

1091


What do you mean by dynamic memory allocation in c? What functions are used?

1165


Describe the order of precedence with regards to operators in C.

1047


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

1220


What is the process to generate random numbers in c programming language?

1178


How can a program be made to print the name of a source file where an error occurs?

1226


Explain what is the advantage of a random access file?

1124


Where define directive used?

1097


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1123


What are unions in c?

1030