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 / pratik panchal

output:5 4 3 2 1

static int store the value of variable for once and
periodically changes its value as the variable value changes
and a-- is done so the assigned value on the next line will
automatically overwrite the value of a.

%3d means print 5 then 2 spaces and 4 and so on..,.main is
called until if statement gets false..if(5) is a true
condition.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1174


code for quick sort?

1984


Why doesnt long int work?

980


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1070


Write a program to find factorial of a number using recursive function.

1065


Where static variables are stored in c?

1041


What is this infamous null pointer, anyway?

987


What are file streams?

964


What is structure and union in c?

1070


Which is better malloc or calloc?

1058


Is null equal to 0 in sql?

1088


What are logical errors and how does it differ from syntax errors?

1231


Explain the difference between #include "..." And #include <...> In c?

982


What is type qualifiers?

1079


What are the standard predefined macros?

1067