Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged promotion
2
votes
0
answers
1
Integer Promotion
We know range of signed char -128 to 127. But in the given code answer is 1200. So, here we should get an overflow.Integer Promotion occurs which prevents to cause it overflow. How integer promotion works here? #include <stdio.h> int main() { char a = 30, b = 40, c = 10; char d = (a * b) / c; printf ("%d ", d); return 0; }
We know range of signed char -128 to 127. But in the given code answer is 1200. So, here we should get an overflow.Integer Promotion occurs which prevents to cause it ove...
srestha
360
views
srestha
asked
Aug 9, 2018
Programming in C
programming-in-c
promotion
+
–
2
votes
2
answers
2
can anyone explain me how promotion is happening here. I can't understand.
output of the following program is 'no' but why. #include <stdio.h> int main() { if (sizeof(int) > -1) printf("Yes"); else printf("No"); return 0; }
output of the following program is 'no' but why. #include <stdio.h>int main(){ if (sizeof(int) -1) printf("Yes"); else printf("No"); return 0;}
Khushal Kumar
698
views
Khushal Kumar
asked
Jul 4, 2017
Programming in C
programming-in-c
promotion
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register