This quiz tests your knowledge of input and output operations in C++. It contains 10 questions.
Question 2
Which of the following symbol is used to declare the preprocessor directives in C++?
$
^
*
#
Question 5
What will be the output of the following C++ code?
#include <iostream> using namespace std; int main() { char c = 74; cout << c; return 0; }
I
A
J
N
Question 6
What will be the output of the following C++ code?
#include<iostream>
using namespace std;
int main ()
{
int cin;
cin >> cin;
cout << "cin: " << cin;
return 0;
}
Segmentation fault
cin: 0
Error
Nothing is printed
Question 7
What is meant by ofstream in c++?
Writes to a file
Reads from a file
Writes to a file & Reads from a file
delete a file
Question 8
What can be used to input a string with blank space?
inline
getline
putline
setline
Question 9
Which of the following escape sequences represents carriage return?
\r
\n
\n\r
\c
Question 10
What will be the output of the following C++ code?
#include<iostream> using namespace std; int x[67]; int main() { cout << x[62] << endl; }
Garbage value
67
62
0
There are 10 questions to complete.