PAGETURNER
SOMECLEAN
ENCORE1
CLEAN
BOX
SOLUTION
GO
Let's act like the C Compiler to
solve this problem!
Let us recall that we are given 4 (four) variables:
char name[]; with value of c_class
int a; with value of 27
float b; with value of 137.6
char c; with value of K
Using the variable a as the argument
please type in the result produced with
the format specifier %5d:
12345
Answer here:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the result is right justified!
You will have 3 blanks followed by 27
Please Review the UNIX I/O System Calls!
12345
FORGET1
The correct choice is 27.
12345
Using the variable a as the argument
please type in the result produced with
the format specifier %7o:
1234567
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the result is right justified!
You will have 5 blanks followed by 33
Please Review the UNIX I/O System Calls!
1234567
FORGET2
The correct choice is 33.
1234567
Using the variable a as the argument
please type in the result produced with
the format specifier %5x:
12345
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the Hex value of 27 decimal?
You will have 3 blanks followed by 1b
Please Review C Constants and Formatting!
12345
FORGET3
The correct choice is 1b.
12345
Using the variable a as the argument
please type in the result produced with
the format specifier %5u:
12345
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, U stands for unsigned i.e. integer
You will have 3 blanks followed by 27
Please Review the Format Specifiers!
12345
FORGET4
The correct choice is 27.
12345
Using the variable b as the argument
please type in the result produced with
the format specifier %10e:
123456789012
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, This is exponential notation
You will have 1.37 with 0's ended with e+02
Please Review Exponential Format Specifiers!
123456789012
FORGET5
The correct choice is 1.376000e+02.
123456789012
Using the variable b as the argument
please type in the result produced with
the format specifier %10.4f:
1234567890
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the fractional part is 4 chars. long!
Your will have 2 blanks, 137. and the decimal part!!
Please Review the C Format Specifiers and floats!
1234567890
FORGET6
The correct choice is 137.6000.
1234567890
Using the variable b as the argument
please type in the result produced with
the format specifier %5g:
1234567..
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the result is left justified!
The floating point representation, i.e. 137.6 is the shortest!
Please Review the C Format Specifiers !!
1234567..
FORGET7
The correct answer is 137.6 .
1234567..
Using the variable c as the argument
please type in the result produced with
the format specifier %5c:
12345
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the result is right justified!
You will have 4 blanks followed by K.
Please Review the C Character Format Specifiers !
12345
FORGET8
The correct choice is K.
12345
Using the variable name as the argument
please type in the result produced with
the format specifier %15s:
123456789012345
Please Type:
That is correct!
You've got it on the 2nd try.
You've got it finally!
Think, the result is right justified!
You should have 8 blanks followed by c_class.
Please Review C Character Strings Format Specifiers !
123456789012345
FORGET9
The correct choice is c_class.
123456789012345