#ifdef something

int some=0;

#endif

main()

{

int thing = 0;

printf("%d %d\n", some ,thing);

}



#ifdef something int some=0; #endif main() { int thing ..

Answer / susie

Answer :

Compiler error : undefined symbol some

Explanation:

This is a very simple example for conditional compilation.
The name something is not already known to the compiler
making the declaration

int some = 0;

effectively removed from the source code.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


Is this code legal? int *ptr; ptr = (int *) 0x400;

1 Answers  






main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


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

3 Answers  


can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  


write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,


struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


Categories