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
What are the c keywords?
Is c++ based on c?
Explain bit masking in c?
What are local variables c?
What do you mean by a local block?
What are directives in c?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is a global variable in c?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is the newline escape sequence?
Why do we need a structure?
Explain how can a program be made to print the line number where an error occurs?
How do you define a function?
What is build process in c?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?