Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


main()

{

extern int i;

i=20;

printf("%d",sizeof(i));

}

Answers were Sorted based on User's Feedback



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

Answer / susie

Answer :

Linker error: undefined symbol '_i'.

Explanation:

extern declaration specifies that the variable i is defined
somewhere else. The compiler passes the external variable to
be resolved by the linker. So compiler doesn't find an
error. During linking the linker searches for the definition
of i. Since it is not found the linker flags an error.

Is This Answer Correct ?    22 Yes 4 No

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

Answer / sahoo845

This program throws error in compilation. Because variable i is declared but not defined anywhere. Essentially, the variable isn’t allocated any memory. And the program is trying to change the value to 20 of a variable that doesn’t exist at all.

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C Code Interview Questions

Develop a routine to reflect an object about an arbitrarily selected plane

0 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


String reverse with time complexity of n/2 with out using temporary variable.

10 Answers   NetApp, Symantec,


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

1 Answers   Value Labs,


1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.

6 Answers   Fusion Systems GmbH,


x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);

2 Answers  


main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }

2 Answers   Wipro,


WAP to display 1,2,3,4,5........N

2 Answers  


find simple interest & compund interest

2 Answers  


Categories