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 c language still used?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Why do we write return 0 in c?
Tell me with an example the self-referential structure?
List the difference between a While & Do While loops?
Write a program to swap two numbers without using the third variable?
Why c language is called c?
Are pointers integer?
C language questions for civil engineering
ATM machine and railway reservation class/object diagram
What are terms in math?
What is declaration and definition in c?
What is the difference between array_name and &array_name?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.