Page 39 - Modular_V1.1_Flipbook
P. 39
B. Write ‘T’ for true and ‘F’ for false.
1. The \\ escape sequence character is used to add a backslash. ……………………
2. The /* and */ symbols are used to add multiline comment. ……………………
3. Comments are executed by C++ compiler. ……………………
4. The endl manipulator is used to insert a line break. ……………………
C. Fill in the blanks using the words given below.
comments, cin, ostream, break
1. The \n escape sequence character is used to add a line …………………………. .
2. The …………………………. object is used in conjunction with the extraction operator >>.
3. The cout is an instance of the …………………………. class.
4. …………………………. enables us to understand the way a program works.
D. Short answer type questions.
1. How many types of comments are there in C++? Write their names.
2. What is the difference between \\ and // symbols?
3. What is the purpose of escape sequence characters?
E. Long answer type questions.
1. What is the use of cout object? Give an example.
2. What is difference between cout and cin objects?
F. What will be the output of the following codes?
1. cout<<”Hello\t”; 2. int age;
cout<<”Touchpad”; cout<<”Enter your age: “;
cin>>age;
cout<<age;
Critical Thinking
In the lab
Write a C++ program to:
accept your first name and last name as input and display them as your full name.
accept your marks of five subjects as input and display the percentage you have scored.
accept distance in kilometre and convert it into metres and centimetres.
Teacher's Corner
Do a walk-through of all the topics discussed in the chapter.
Input and Output in C++ 37

