main()

{

extern int i;

{ int i=20;

{

const volatile unsigned i=30; printf("%d",i);

}

printf("%d",i);

}

printf("%d",i);

}

int i;



main() { extern int i; { int i=20; { const volatile unsigned i=30; ..

Answer / pavan_mustyala

1st printf o/p is 30
2nd printf o/p is 20
3rd printf o/p is 0

Reason: O/p depends on scope of variable.

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More C Code Interview Questions

main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }

6 Answers  


Finding a number which was log of base 2

1 Answers   NetApp,


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,






void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }

1 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

1 Answers  


How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come

2 Answers   GATE,


There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


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

8 Answers   Microsoft,


Categories