Question
Show that the following program running on Pentium prints fff0 f0 fffffff0 f0 ========== Program ================= #include void main() { char c; unsigned char uc;
Show that the following program running on Pentium prints
fff0 f0
fffffff0 f0
========== Program =================
#include
void main() {
char c;
unsigned char uc;
short s1, s2;
unsigned short us1, us2;
c = 0xf0; uc = 0xf0;
us1 = c; us2 = uc;
printf("us1 = %8x,\tus2 = %8x ", us1, us2);
s1 = c; s2 = uc;
printf("us1 = %8x,\tus2 = %8x ", s1, s2);
}
Show the following steps:
Step1 show the values in c and uc
Step2 show the integral promoted values of c and uc
Step3 show the values in us1 and us2
Step4 show the integral promoted values of us1 and us2
(these are the values printed by the first printf statement)
Step5 show the integral promoted values of c and uc
(they are the same as those values in Step2)
Step6 show the values in s1 and s2
Step7 show the integral promoted values of s1 and s2
(these are the values printed by the second printf statement)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started