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
What is the scope of global variable in c?
How to draw the flowchart for structure programs?
What is the difference between single charater constant and string constant?
Explain how can I avoid the abort, retry, fail messages?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What is the use of a conditional inclusion statement in C?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
Explain how do you sort filenames in a directory?
Why is c called c?
What is the difference between class and object in c?
Which header file is used for clrscr?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
Can you please explain the difference between strcpy() and memcpy() function?
Explain what are preprocessor directives?