Contents

What will the following code display?
int a=2, b=4, c=6;
cout<<a<<b<<c<<endl;
a) 246   
b) 426   
c) 642    
d) abc

a

What will the following code display?
int n=2;
cout<<” the number is” <<n<<endl;
a) the number is 2              
b) THE number is 2
c) the number is n               
d) the number is 0

a

What will the following code display?
cout<<” My name is” <<” Abdullah<<endl;
a) My name is Abdullah  
b) my Name is Abdullah
c) My name is ABDULLAH                             
d) MY name is Abdullah

a

Which of the following statement prints Abdullah\exercise\test.txt?
a) cout<<” Abdullah\exercise\test.txt”;
b) cout<<” Abdullah\\exercise\\test.txt”;
c) cout<<” Abdullah\” exercise\” test.txt”;    
d) cout<<” Abdullah” \exercise”\test.txt”;

b

Which of the following is correct structure for adding new data in file?
a) outfile. open (“file.dot”, ios::out| ios::trunc);
b) afile. open (“file.dot”, ios::out|ios::in);
c) file. open (“test.bin”, ios::out|ios::app);
d) all of these

c

How many types of manipulators in C++?
a) one    
b) three 
c) six     
d) four

c

Explanation: endl, setw, setprecision, setfill, showpoint, fixed