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
Is boolean a datatype in c?
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What are the restrictions of a modulus operator?
What is the best way to comment out a section of code that contains comments?
What is the collection of communication lines and routers called?
What is methods in c?
What is c language and why we use it?
how to introdu5ce my self in serco
What is the default value of local and global variables in c?
What is a spanning Tree?
How do I swap bytes?
Differentiate between Macro and ordinary definition.
Why is python slower than c?
Distinguish between actual and formal arguments.