+ 1
C Programming, Justify with answer.!!
#include<stdio.h> int main() { if(sizeof(int) > - 1) printf("Yes"); else printf("No");
2 odpowiedzi
+ 5
Because sizeof(int) returns unsigned int(that is positive integers) and it makes no sense comparing unsigned int with signed(negative integers), so its false.
hence No is printed.
NOT SATISFIED?
Read this...
https://stackoverflow.com/questions/5416414/signed-unsigned-comparisons
+ 3
As RKK said, sizeof returns unsigned int. While comparing unsigned int to signed int, signed implicitly converts to unsigned. -1 converts to unsigned is 2^32-1. Thus the comparation returns false.