main()

{

static int var = 5;

printf("%d ",var--);

if(var)

main();

}



main() { static int var = 5; printf("%d ",var--); if(var) main(); ..

Answer / susie

Answer :

5 4 3 2 1

Explanation:

When static storage class is given, it is
initialized once. The change in the value of a static
variable is retained even between the function calls. Main
is also treated like any other ordinary function, which can
be called recursively.

Is This Answer Correct ?    50 Yes 22 No

Post New Answer

More C Code Interview Questions

main() { extern int i; i=20; printf("%d",i); }

1 Answers   Value Labs,


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


write a program for area of circumference of shapes

0 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  






create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.

16 Answers   Aricent, Cisco, Directi, Qualcomm,


main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5

2 Answers   HCL,


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


What are the files which are automatically opened when a C file is executed?

1 Answers  


Link list in reverse order.

8 Answers   NetApp,


Categories