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

How we print the table of 2 using for loop in c programing?

14 Answers   HCL, Wipro,


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

10 Answers   Microsoft,


source code for delete data in array for c

1 Answers   TCS,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,






could you please send the program code for multiplying sparse matrix in c????

0 Answers  


Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error

1 Answers   HCL,


write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


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

2 Answers  


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


Categories