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

Write a Program to find whether the given number or string is palindrome.

1274


What is a list in c?

1027


what are the advantages of a macro over a function?

1141


What is dynamic memory allocation?

1335


What is the difference between fread and fwrite function?

1077


What is the difference between malloc() and calloc()?

1842


What is typeof in c?

1008


What is the scope of global variable in c?

988


When is a null pointer used?

1108


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

1068


What is a global variable in c?

1003


What do header files do?

1072


how do you execute a c program in unix.

1111


can we change the default calling convention in c if yes than how.........?

2531


What happens if you free a pointer twice?

1068