main()

{

extern i;

printf("%d\n",i);

{

int i=20;

printf("%d\n",i);

}

}



main() { extern i; printf("%d\n",i); { int i=20; ..

Answer / susie

Answer :

Linker Error : Unresolved external symbol i

Explanation:

The identifier i is available in the inner block and so
using extern has no use in resolving it.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Code Interview Questions

What is full form of PEPSI

0 Answers  


Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

1 Answers  


void main() { int i=5; printf("%d",i++ + ++i); }

3 Answers  


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

0 Answers  






main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 Answers  


how to return a multiple value from a function?

5 Answers   Wipro,


main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


program to find magic aquare using array

4 Answers   HCL,


#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

1 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Write a single line c expression to delete a,b,c from aabbcc

2 Answers   Microsoft,


Categories