#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 ?    10 Yes 1 No

Post New Answer

More C Code Interview Questions

To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


write a c program to print magic square of order n when n>3 and n is odd?

1 Answers   HCL,


Write a routine to implement the polymarker function

0 Answers   TCS,






what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  


void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }

1 Answers   Honeywell,


main() { main(); }

1 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


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

1 Answers  


void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }

3 Answers  


respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"

1 Answers   Genpact, Ozdocs,


Categories