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 below code?
main()
{
static in a=5;
printf("%3d",a--);
if(a)
main();
}

Answer Posted / srinivas reddy m v

54321

here main() is called again in main function
this leads to recursion....

the function is called until a become 0.
value is retained as static key word is used.

not much clear about usage of "%3d"

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by recursion in c?

1115


List some basic data types in c?

1030


What is a void pointer in c?

1111


What is zero based addressing?

1177


When should I declare a function?

1138


What are the disadvantages of external storage class?

1062


Can you write the algorithm for Queue?

2125


Tell me what are bitwise shift operators?

1133


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1560


How can I ensure that integer arithmetic doesnt overflow?

1173


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

1198


Why shouldn’t I start variable names with underscores?

1067


What is #define used for in c?

1066


What are the string functions? List some string functions available in c.

993


define string ?

1113