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

Write a program to print a square of size 5 by using the character S.

6 Answers   Microsoft,


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  


To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false

1 Answers   Cognizant, lenovo,


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

0 Answers   Honeywell,






#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

1 Answers  


void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 Answers  


main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 Answers  


Categories