You are on page 1of 2

DEPARTMENT OF INFORMATION TECHNOLOGY & COMMUNICATION

DFC 20113 – PROGRAMMING FUNDAMENTALS

QUIZ 1 : PROGRAM CONTROL STRUCTURE

Total Marks : /10


LEARNING OUTCOME
1. Explain briefly the basic concepts of programming and approaches.
2. Apply the program structure and debugging process in C++ programming language accordingly.
QUESTONS

A. Indicate whether the statement is true or false. (CLO1, PLO1)

____ 1. Every C++ program must have a function called main.

TRUE

____ 2. The following is a legal C++ identifier: Hello!

FALSE

____ 3. The data type double is a floating-point data type.

TRUE

____ 4. The value of the expression 8 * 5 % 3 is 16.

FALSE

____ 5. Suppose that count is an int variable. The statements --count; and count--; both decrement the value
of count by 2.

FALSE

B. Identify the choice that best completes the statement below. (CLO1, PLO2)

6. Which of the following is a legal identifier?

a. program! c. 1program
b. program_1 d. program 1

7. Choose the output of the following C++ statement:

cout << "Sunny " << '\n' << "Day " << endl;

a. Sunny \nDay
b. Sunny \nDay endl
c. Sunny
Day
d. Sunny \n
Day
8. Which of the following is the correct syntax for commenting in C++?

a. # Enter Comments Here


b. // Enter Comments Here //
c. /* Enter Comments Here*/
d. ** Enter Comments Here **

9. What the output for this statement :

int A=10, B=3;


cout<<”A / B = “<<(A/B)<<” A % B = “<<(A%B);

a. A / B = 3.5 A % B = 3.5
b. A/B=3A%B=1
c. A/B=1A%B=3
d. 31

10. Choose the right statement when produce this output with initial: int A=2, B=5;

A + B = 10, NILAI A 5 DAN NILAI B 2

a. cout<<”A + B = “<<(A+B)<<”, NILAI A”<<A<<” DAN NILAI B “<<B;


b. cout<<”A + B = “<<(A*B)<<”, NILAI A”<<A<<” DAN NILAI B “<<B;
c. cout<<”A + B = “<<(A*B)<<”, NILAI A”<<B<<” DAN NILAI B “<<A;
d. cout<<”A + B = “<<(A+B)<<”, NILAI A”<<B<<” DAN NILAI B “<<A;

You might also like