In: Computer Science
QUESTION 6
A single line comment in C++ language source code can begin with _____
a) //
b) ;
c) :
d) /*
QUESTION 7
What is the output of the following program?
#include<iostream> using namespace std; class abc { public: int i; abc(int i) { i = i; } }; main() { abc m(5); cout<<m.i; }
a)Garbage
b)5
c)Compile Error
d)None of the answers
QUESTION 8
The following operator can be used to calculate the value of one number raised to another.
a)None of the answers
b) ^
c)**
d) ^^
QUESTION 9
What is the output of the following program?
#include <iostream> using namespace std; int main () { // local variable declaration: int x = 1; switch(x) { case 1 : cout << "Hi!" << endl; break; default : cout << "Hello!" << endl; } }
a) Hi
b)Hello
c)HelloHi
d)Compile Error
QUESTION 10
What is the output of the following program?
#include<iostream> using namespace std; main() { int a[] =
{1, 2}, *p = a; cout<<p[1]; }
a)2
b)1
c)Compile Error
d)Runtime Error
6. A single line comment in C++ language source code can begin with a) //
7.What is the output of the following program?
#include<iostream> using namespace std; class abc { public: int i; abc(int i) { i = i; } }; main() { abc m(5); cout<<m.i; }
b)5
8. The following operator can be used to calculate the value of one number raised to another.a)None of the answers.
We can do this using pow() function. In python we can use **.
9.What is the output of the following program?
#include <iostream> using namespace std; int main () { // local variable declaration: int x = 1; switch(x) { case 1 : cout << "Hi!" << endl; break; default : cout << "Hello!" << endl; } }
a) Hi
10. What is the output of the following program?
#include<iostream> using namespace std; main() { int a[] =
{1, 2}, *p = a; cout<<p[1]; }
b)1
Please give a upvote if u feel helpful.