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
What is the size of empty structure in c?
What are pointers in C? Give an example where to illustrate their significance.
Give basis knowledge of web designing ...
What is the use of pragma in embedded c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
which type of aspect you want from the student.
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is dangling pointer in c?
What is #define size in c?
What is a memory leak? How to avoid it?
Are negative numbers true in c?
In C, What is the #line used for?
Explain the meaning of keyword 'extern' in a function declaration.
What is a macro in c preprocessor?