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

A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2308


List the difference between a While & Do While loops?

1153


How many types of functions are there in c?

1226


What is the purpose of the preprocessor directive error?

1315


How can I open a file so that other programs can update it at the same time?

1239


Why is c not oop?

1038


Explain the difference between ++u and u++?

1187


Explain 'far' and 'near' pointers in c.

1187


write a program to rearrange the array such way that all even elements should come first and next come odd

2354


Is a house a mass structure?

1154


What is include directive in c?

1207


What is optimization in c?

1070


What are the types of unary operators?

1252


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1396


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2851