void main()

{

if(~0 == (unsigned int)-1)

printf(“You can answer this if you know how values are
represented in memory”);

}



void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if yo..

Answer / susie

Answer :

You can answer this if you know how values are
represented in memory

Explanation

~ (tilde operator or bit-wise negation operator) operates on
0 to produce all ones to fill the space for an integer. –1
is represented in unsigned value as all 1’s and so both are
equal.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Code Interview Questions

Write a routine to implement the polymarker function

0 Answers   TCS,


Cau u say the output....?

1 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  


Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];

1 Answers  






main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

2 Answers   CNSI,


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


Find your day from your DOB?

15 Answers   Accenture, Microsoft,


main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


Categories