05 Types Tutorial Mod
05 Types Tutorial Mod
Tutorial Questions
a) 07
b) 077
c) 0777
a) 0x123
b) 0x321
c) 0XABC
d) 0XCBA
a) 07
b) 077
c) 0777
a) 0x123
b) 0x321
c) 0XABC
d) 0XCBA
a) 010E2
b) 32.1E+5
c) 0790
d) 100_000
e) 3.978e-2
P.T.O. ...
These questions are taken from the recommended textbook for this course:
K. N. King. C Programming; a Modern Approach (Second Edition). Norton and Company, 2008.
6. Assuming an ASCII character set, which one of the following is not a legal way to
write the number 65?
a) ‘A’
b) 0b1000001
c) 0101
d) 0x41
7. For each of the following types of data, specify which one of char, short, int or
long is the smallest one guaranteed to be able to store the data.
a) Days in a month
b) Days in a year
c) Minutes in a day
d) Seconds in a day
i / j + ‘a’ ?
i * f / d ?
10. Assuming
char c = ‘1’;
short s = 2;
int i = -3;
long m = 5;
float f = 6.5f
double d = 7.5;
a) c * i
b) s + m
c) f / c
d) d / s
e) f – d
f) (int) f
11. Use typedef to create types to represent 8-bit, 16-bit and 32-bit integers.
These questions are taken from the recommended textbook for this course:
K. N. King. C Programming; a Modern Approach (Second Edition). Norton and Company, 2008.