wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C programming Chapter 4 Quiz

Total questions: 10

Worksheet time: 3hrs 30mins

Name
Class
Date
1.

int main ()


{


int x = 24, y = 39, z = 45;


printf ("%d %d %d", y, x, z);


}

a)

24 39 45

b)

39 24 45

c)

45 39 24

d)

39 45 24

2.

Which is the only function all C programs must contain?

a)

start()

b)

system()

c)

printf()

d)

main()

3.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

char

4.

Which symbol terminates a C statement?

a)

.

b)

;

c)

,

d)

}

5.

What function is use to display a message?

a)

printf

b)

print

c)

output

6.

What does \n do?

a)

creates a tab

b)

goes to a new line

c)

sounds the computer's alarm.

d)

prints a double quote mark

7.

What does \t do?

a)

creates a tab

b)

prints a backslash

c)

goes to a new line

d)

sounds the computer's alarm

8.

For the following float number 1.234500, what would be the output for %.3f in a printf statement?

a)

1.234500

b)

1.2345

c)

1.23

d)

123.4500

9.

What type of variable does the %s conversion character stand for?

a)

character

b)

integer

c)

floating point

d)

string

10.

What type of variable does the %d conversion character stand for?

a)

string

b)

integer

c)

character

d)

floating point