C++ Programming 3
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 : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
- Question 2 of 20
2. Question
1 pointsCorrectAnswer : B
Explanation : No answer description
IncorrectAnswer : B
Explanation : No answer description
- Question 3 of 20
3. Question
1 pointsCorrectAnswer : A
Explanation : The try block is used to check for errors, if any error it throws to catch block.
IncorrectAnswer : A
Explanation : The try block is used to check for errors, if any error it throws to catch block.
- Question 4 of 20
4. Question
1 points.
What is the output of this program?
#include <iostream>
#include “math.h”
using namespace std;
double MySqrt(double d)
{
if (d < 0.0)
throw “Cannot take sqrt of negative number”;
return sqrt(d);
}
int main()
{
double d = 5;
cout << MySqrt(d) << endl;
}
CorrectAnswer : B
Explanation : We are finding the square root of the number, if it is a positive number, it can manipulate, Otherwise it will arise a exception.
IncorrectAnswer : B
Explanation : We are finding the square root of the number, if it is a positive number, it can manipulate, Otherwise it will arise a exception.
- Question 5 of 20
5. Question
1 pointsCorrectAnswer : A
Explanation : A constructor don’t have return type, We have to throw an exception.
IncorrectAnswer : A
Explanation : A constructor don’t have return type, We have to throw an exception.
- Question 6 of 20
6. Question
1 pointsCorrectAnswer : B
Explanation : No answer description.
IncorrectAnswer : B
Explanation : No answer description.
- Question 7 of 20
7. Question
1 pointsCorrectAnswer : A
Explanation : A template parameter is a special kind of parameter that can be used to pass a type as argument.
IncorrectAnswer : A
Explanation : A template parameter is a special kind of parameter that can be used to pass a type as argument.
- Question 8 of 20
8. Question
1 pointsCorrectAnswer : C
Explanation : No answer description.
IncorrectAnswer : C
Explanation : No answer description.
- Question 9 of 20
9. Question
1 pointsCorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description.
- Question 10 of 20
10. Question
1 pointsCorrectAnswer : D
Explanation : No answer description.
IncorrectAnswer : D
Explanation : No answer description.
- Question 11 of 20
11. Question
1 pointsCorrectAnswer : C
Explanation : Multiple inheritance enables a derived class to inherit members from more than one parent.
IncorrectAnswer : C
Explanation : Multiple inheritance enables a derived class to inherit members from more than one parent.
- Question 12 of 20
12. Question
1 pointsCorrectAnswer : D
Explanation : No answer description.
IncorrectAnswer : D
Explanation : No answer description.
- Question 13 of 20
13. Question
1 points.
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str (“Ubuntu”);
cout << str.capacity();
cout << str.max_size();
return 0;
}
CorrectAnswer : C
Explanation : In this program, We are printing the capacity and maximum size of the string.
IncorrectAnswer : C
Explanation : In this program, We are printing the capacity and maximum size of the string.
- Question 14 of 20
14. Question
1 points.
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str (“steve jobs is legend”);
string::iterator it;
str.erase (str.begin()+ 5, str.end()-7);
cout << str << endl;
return 0;
}
CorrectAnswer : B
Explanation : Here, We are leaving the first 5 characters and last 7 characters and we are erasing the remaining the characters.
IncorrectAnswer : B
Explanation : Here, We are leaving the first 5 characters and last 7 characters and we are erasing the remaining the characters.
- 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 : B
Explanation : We can declare the complex number by using complex(3,4) where 3 is a real number and 4 is imaginary part.
IncorrectAnswer : B
Explanation : We can declare the complex number by using complex(3,4) where 3 is a real number and 4 is imaginary part.
- Question 17 of 20
17. Question
1 points.
What is the output of this program?
#include <iostream>
#include <complex>
using namespace std;
int main()
{
complex<int> i(2, 3);
i = i * 6 / 3;
cout << i;
return 0;
}
CorrectAnswer : A
Explanation : We are multiplying the complex number by 2.
IncorrectAnswer : A
Explanation : We are multiplying the complex number by 2.
- Question 18 of 20
18. Question
1 pointsCorrectAnswer : D
Explanation : No answer description.
IncorrectAnswer : D
Explanation : No answer description.
- Question 19 of 20
19. Question
1 pointsCorrectAnswer : D
Explanation : Operator overloading is the way adding operation to the existing operators.
IncorrectAnswer : D
Explanation : Operator overloading is the way adding operation to the existing operators.
- Question 20 of 20
20. Question
1 pointsCorrectAnswer : A
Explanation : No answer description.
IncorrectAnswer : A
Explanation : No answer description.