C++ Programming 2
Questions Result & StatisticsQuiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Questions
Instruction:
- Total number of questions : 20
- Time allotted : 25 minutes.
- Each question carry 1 mark, no negative marks.
- Click the “Finish quiz” button given in bottom of this page to submit your answer.
- Test will be submitted automatically if the time expired.
- Don’t refresh the page.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
Marks : 0 of 20 questions answered correctly | ||
Total number of questions | : | 20 |
Number of currect answered | : | 0 |
Your time | : |
|
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- Not categorized 0%
-
Thank you for submitting online test!
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
1 pointsCorrectAnswer : A
Explanation : No answer description
IncorrectAnswer : A
Explanation : No answer description
-
Question 2 of 20
2. Question
1 pointsCorrectAnswer: C
Explanation : No answer description
IncorrectAnswer: C
Explanation : No answer description
-
Question 3 of 20
3. Question
1 pointsCorrectAnswer : C
Explanation : No answer description
IncorrectAnswer : C
Explanation : No answer description
-
Question 4 of 20
4. Question
1 pointsCorrectAnswer : D
Explanation : No answer description
IncorrectAnswer : D
Explanation : No answer description
-
Question 5 of 20
5. Question
1 pointsCorrectAnswer : B
Explanation : No answer description
IncorrectAnswer : B
Explanation : No answer description
-
Question 6 of 20
6. Question
1 points.
Which inheritance type is used in the class given below?
class A : public X, public Y
{
}
CorrectAnswer : D
Explanation : No answer description
IncorrectAnswer : D
Explanation : No answer description
-
Question 7 of 20
7. Question
1 points.
What is the output of this program?
#include <iostream>
using namespace std;
class myclass
{
public:
int i;
myclass *operator->()
{return this;}
};
int main()
{
myclass ob;
ob->i = 10;
cout << ob.i << ” ” << ob->i;
return 0;
}
CorrectAnswer : B
Explanation : In this program, -> operator is used to describe the member of the class.
IncorrectAnswer : B
Explanation : In this program, -> operator is used to describe the member of the class.
-
Question 8 of 20
8. Question
1 points.
What is the output of this program?
#include <iostream>
using namespace std;
ostream & operator<<(ostream & i, int n)
{
return i;
}
int main()
{
cout << 5 << endl;
cin.get();
return 0;
}
CorrectAnswer : C
Explanation : In this program, there will arise an ambiguous overload for 5.
IncorrectAnswer : C
Explanation : In this program, there will arise an ambiguous overload for 5.
-
Question 9 of 20
9. Question
1 pointsCorrectAnswer : A
Explanation : Friend is used to access private and protected members of a class from outside the same class.
IncorrectAnswer : A
Explanation : Friend is used to access private and protected members of a class from outside the same class.
-
Question 10 of 20
10. Question
1 pointsCorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
-
Question 11 of 20
11. Question
1 points.
What is the output of this program?
#include <stdio.h>
using namespace std;
int main()
{
int a = 21;
int c ;
c = a++;
cout << c;
return 0;
}
CorrectAnswer : B
Explanation : value of ‘a’ will be stored in c and then only it will be incremented.
IncorrectAnswer : B
Explanation : value of ‘a’ will be stored in c and then only it will be incremented.
-
Question 12 of 20
12. Question
1 points.
What is the output of this program?
#include <stdio.h>
using namespace std;
int main()
{
int x = 5, y = 5;
cout << ++x << –y << endl;
return 0;
}
CorrectAnswer : B
Explanation : The values will be preincremented and predecremented, So it will print as 64.
IncorrectAnswer : B
Explanation : The values will be preincremented and predecremented, So it will print as 64.
-
Question 13 of 20
13. Question
1 points.
What is the output of this program?
#include <stdio.h>
using namespace std;
int main()
{
int x = 5, y = 5, z;
x = ++x; y = –y;
z = x++ + y–;
cout << z;
return 0;
}
CorrectAnswer : B
Explanation : The increment and decrement of evaluation of z will not be accounted because they are post.
IncorrectAnswer : B
Explanation : The increment and decrement of evaluation of z will not be accounted because they are post.
-
Question 14 of 20
14. Question
1 pointsCorrectAnswer : A
Explanation : Because preincrement take one byte instruction & post increment takes two byte instruction.
IncorrectAnswer : A
Explanation : Because preincrement take one byte instruction & post increment takes two byte instruction.
-
Question 15 of 20
15. Question
1 pointsCorrectAnswer : B
Explanation : No answer description.
IncorrectAnswer : B
Explanation : No answer description.
-
Question 16 of 20
16. Question
1 pointsCorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description.
-
Question 17 of 20
17. Question
1 pointsCorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
-
Question 18 of 20
18. Question
1 points.
What is the output of the program
#include<iostream.h>
void main()
{
int n=1;
cout<<endl<<“The numbers are;”<<endl;
do
{
cout <<n<<“\t”;
n++;
} while (n<=100);
cout <<endl;
}
CorrectAnswer : D
Explanation : No answer description.
IncorrectAnswer : D
Explanation : No answer description.
-
Question 19 of 20
19. Question
1 points.
Everything defined at the program scope level (ie. outside functions and classes) is said to be ……………
CorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
-
Question 20 of 20
20. Question
1 pointsCorrectAnswer : B
Explanation : Because it is having the proper data set to initialize, Otherwise it will throw a error.
IncorrectAnswer : B
Explanation : Because it is having the proper data set to initialize, Otherwise it will throw a error.