CPS 188 EXAM STUDY SET WITH COMPLETE SOLUTIONS!!
# bits in byte - ANSWER 8
# bytes for character - ANSWER 1
# of bytes for integers - ANSWER 4
# of bytes float (single and double ) - ANSWER
A (Decimal,Binary, & Oct) - ANSWER 10 , 1010, 12
B ((Decimal,Binary, & Oct)) - ANSWER 11, 1011, 13
C (Decimal,Binary, & Oct) - ANSWER 12, 1100, 14
D (Decimal,Binary, & Oct) - ANSWER 13, 1101,15
E(Decimal,Binary, & Oct) - ANSWER 14,1110,16
F(Decimal,Binary, & Oct) - ANSWER 15,1111,17
10(hex) to decimal - ANSWER 16
What do libraries end with - ANSWER .h
,Single line comment - ANSWER Starts with // and includes all the following text on that
line
multiple line comments - ANSWER begin with /* and end with */
List of reserved words(can't be variables) - ANSWER 1.double
2.char
3.int
4.do
5.float
6.if
7.return
8.sizeof
9.void
10.void
11.while
12.typedef
13.struct
14.switch
15.for
16.else
What can be used in a. Variable - ANSWER 1. _
2.charaters
3. Numbers(can't start )
int place holder - ANSWER %d
, Double place holder - ANSWER %lf
Float place holder - ANSWER %f
a=45
What does printf("%-5d",a) output - ANSWER 45###
Double a=45.8
What does printf("%lf",a) output - ANSWER 45.800000 (6decimal places)
What does % do - ANSWER returns the remainder of the division
If a = -32.4578 what does %8.3 output - ANSWER #-32.458
Does formation such as %3.2lf effect the value of the varrible - ANSWER No , only screen
appearance
Format for fprintf - ANSWER (filename,"%placeholder", varrible(if needed))
What type of functions are math.h - ANSWER Double
floor(x) - ANSWER Largest whole number that is smaller
eg floor(37.5) = 37
ceil(x) - ANSWER The smallest whole number that is bigger
eg ceil(37.1)=38
# bits in byte - ANSWER 8
# bytes for character - ANSWER 1
# of bytes for integers - ANSWER 4
# of bytes float (single and double ) - ANSWER
A (Decimal,Binary, & Oct) - ANSWER 10 , 1010, 12
B ((Decimal,Binary, & Oct)) - ANSWER 11, 1011, 13
C (Decimal,Binary, & Oct) - ANSWER 12, 1100, 14
D (Decimal,Binary, & Oct) - ANSWER 13, 1101,15
E(Decimal,Binary, & Oct) - ANSWER 14,1110,16
F(Decimal,Binary, & Oct) - ANSWER 15,1111,17
10(hex) to decimal - ANSWER 16
What do libraries end with - ANSWER .h
,Single line comment - ANSWER Starts with // and includes all the following text on that
line
multiple line comments - ANSWER begin with /* and end with */
List of reserved words(can't be variables) - ANSWER 1.double
2.char
3.int
4.do
5.float
6.if
7.return
8.sizeof
9.void
10.void
11.while
12.typedef
13.struct
14.switch
15.for
16.else
What can be used in a. Variable - ANSWER 1. _
2.charaters
3. Numbers(can't start )
int place holder - ANSWER %d
, Double place holder - ANSWER %lf
Float place holder - ANSWER %f
a=45
What does printf("%-5d",a) output - ANSWER 45###
Double a=45.8
What does printf("%lf",a) output - ANSWER 45.800000 (6decimal places)
What does % do - ANSWER returns the remainder of the division
If a = -32.4578 what does %8.3 output - ANSWER #-32.458
Does formation such as %3.2lf effect the value of the varrible - ANSWER No , only screen
appearance
Format for fprintf - ANSWER (filename,"%placeholder", varrible(if needed))
What type of functions are math.h - ANSWER Double
floor(x) - ANSWER Largest whole number that is smaller
eg floor(37.5) = 37
ceil(x) - ANSWER The smallest whole number that is bigger
eg ceil(37.1)=38