Computer Science - Online Test

Q1. Which of the following is not an invariant of the assignment? m, n := m+2, n+3
Answer : Option D
Explaination / Solution:
No Explaination.


Q2. The strcmp() function takes two arguments: string1 and string2. It compares the contents of string1 and string2 lexicographically.
Answer : Option C
Explaination / Solution:
No Explaination.


Q3. Which of the following data types is not a fundamental type?
Answer : Option A
Explaination / Solution:
No Explaination.


Q4. The multi way branching statement:
Answer : Option C
Explaination / Solution:
No Explaination.


Q5. Array subscripts is always starts with which number ?
Answer : Option B
Explaination / Solution:
No Explaination.


Q6. The mechanism by which the data and functions are bound together into a single unit is known as
Answer : Option B
Explaination / Solution:
No Explaination.


Q7.

Which of the following statements about member functions are True or False?

i) A member function can call another member function directly with using the dot operator.

ii) Member function can access the private data of the class.
Answer : Option B
Explaination / Solution:
No Explaination.


Q8.

Based on the following program answer the question

#include

using namespace std;

class Point {

private:

int x, y;

public:

Point(int x1,int y1)

{

x=x1;y=y1;

}

void operator+(Point &pt3);

void show() {cout << "x = " << x << ", y = " << y; } };

void Point::operator+(Point &pt3)

{

x += pt3.x;

y += pt3.y;

}

int main()

{

Point pt1(3,2),pt2(5,4);

pt1+pt2;

pt1.show();

return 0;

}

Which of the following operator is overloaded?

Answer : Option A
Explaination / Solution:
No Explaination.


Q9. Which of the following is true with respect to inheritance?
Answer : Option B
Explaination / Solution:
No Explaination.


Q10. Which one of the following tracks a user visits a website?
Answer : Option B
Explaination / Solution:
No Explaination.