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...


#define FALSE -1

#define TRUE 1

#define NULL 0

main() {

if(NULL)

puts("NULL");

else if(FALSE)

puts("TRUE");

else

puts("FALSE");

}



#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts(&q..

Answer / susie

Answer :

TRUE

Explanation:

The input program to the compiler after processing by the
preprocessor is,

main(){

if(0)

puts("NULL");

else if(-1)

puts("TRUE");

else

puts("FALSE");

}

Preprocessor doesn't replace the values given inside the
double quotes. The check by if condition is boolean value
false so it goes to else. In second if -1 is boolean value
true hence "TRUE" is printed.

Is This Answer Correct ?    12 Yes 4 No

Post New Answer

More C Code Interview Questions

Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


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

3 Answers   CSC,


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

1 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  


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 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  


Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).

1 Answers  


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


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

1 Answers  


Categories