1 1 vote predict the correct options #include <stdio.h> int main() { if (sizeof(int) > -1) printf("Yes"); else printf("No"); return 0; } 1.yes 2.no 3.compiler error 3.garbage value Programming in C + – Shashank Kumar Mishr 943 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
2 2 votes really good question Thanks for post this question sizeof return an unsigned number so -1 also converted into unsigned number which is very big in value that why it will give answer no. if we type case first unsigned sizeof to int than it will give yes answer #include <stdio.h> int main() { if ((int)sizeof(int) > -1) {printf("Yes");} else {printf("No");} return 0; } Nitesh Choudhary answered May 17, 2017 Nitesh Choudhary comment Share Follow 0 reply Please log in or register to add a comment.