main()

{

char not;

not=!2;

printf("%d",not);

}



main() { char not; not=!2; printf("%d",not); }..

Answer / susie

Answer :

0

Explanation:

! is a logical operator. In C the value 0 is considered to
be the boolean value FALSE, and any non-zero value is
considered to be the boolean value TRUE. Here 2 is a
non-zero value so TRUE. !TRUE is FALSE (0) so it prints 0.

Is This Answer Correct ?    17 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


Find your day from your DOB?

15 Answers   Accenture, Microsoft,


Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.

3 Answers   Wipro,






#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


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

1 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  


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

1 Answers   Value Labs,


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!

35 Answers   Tata Elxsi, TCS, VI eTrans,


Categories