Computer Prog.2 Lab2
Computer Prog.2 Lab2
State Finished
Completed on Saturday, 15 October 2022, 3:32 PM
Time taken 4 mins
Marks 18.00/20.00
Grade 90.00 out of 100.00
Question 1
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What punctuation is used to signal the beginning and end of code blocks?
a.
BEGIN
b.
{}
c.
END
d.
->
Feedback
Your answer is correct.
Question 2
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What is the correct value to return to the operating system upon the successful
completion of a program?
a.
Programs do not return a value
b.
0
c.
1
d.
-1
Feedback
Your answer is correct.
Question 3
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What is a constant that contains a single character enclosed within single quotes?
a.
Fixed
b.
Character
c.
Floating Point
d.
Numeric
Feedback
Your answer is correct.
Question 4
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Which function is used to write a single character to console in C++?
a.
write(ch)
b.
printf(ch)
c.
cout.put(ch)
d.
cout.putline(ch)
Feedback
Your answer is correct.
Question 5
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What is the only function all C++ programs must contain?
a.
start()
b.
main()
c.
system()
d.
program()
Feedback
Your answer is correct.
Question 6
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What is the size of a Boolean variable in C++?
a.
2 bytes
b.
1 byte
c.
4 bytes
d.
1 bit
Feedback
Your answer is correct.
Question 7
Incorrect
Mark 0.00 out of 2.00
Flag question
Question text
Which of the following is the correct difference between cin and scanf()?
a.
scanf() is a stream object whereas cin is a function
b.
both are the same
c.
cin is a stream object whereas scanf() is a function
d.
cin is used for printing whereas scanf() is used for reading input
Feedback
Your answer is incorrect.
Question 8
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Which of the following is not a fundamental type is not present in C but present in
C++?
a.
float
b.
void
c.
bool
d.
int
Feedback
Your answer is correct.
Question 9
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Which of the following is called insertion/put to operator?
a.
<<
b.
<
c.
>
d.
>>
Feedback
Your answer is correct.
Question 10
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Which function is used to read a single character from the console in C++?
a.
getline(ch)
b.
scanf(ch)
c.
read(ch)
d.
cin.get(ch)
Feedback
Your answer is correct.