void main()

{

static int i=5;

if(--i){

main();

printf("%d ",i);

}

}



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

Answer / susie

Answer :

0 0 0 0

Explanation:

The variable "I" is declared as static, hence memory for I
will be allocated for only once, as it encounters the
statement. The function main() will be called recursively
unless I becomes equal to 0, and since main() is recursively
called, so the value of static I ie., 0 will be printed
every time the control is returned.

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More C Code Interview Questions

write a origram swaoing valu without 3rd variable

2 Answers  


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

0 Answers  


main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }

2 Answers  


Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print

2 Answers  


main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

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  


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 Answers  


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


why java is platform independent?

13 Answers   Wipro,


main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user

2 Answers   HCL,


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

0 Answers   Honeywell,


Categories