0

Masters of Computer Application (C++)

Description: C++ - An Objective Type Test for the Beginars Who Want to Start their Career in Object Oriented Programming Languages
Number of Questions: 30
Created by:
Tags: COMPUTER MCA Entrance Information Technology General Awareness and Computer Applications Computer Applications (New) Computer Basics Vocabulary in Context Purpose Inference Source/Identity Attitude or Tone Specific Detail Main Idea
Attempted 0/30 Correct 0 Score 0

How many types of storage classes are there in C++?

  1. 4

  2. 5

  3. 3

  4. None of the above


Correct Option: A

What is the output of the following program? #include void main() { enum birds{parrot,crow,pigeon,sparrow}; birds b=pigeon; cout< }

  1. pigeon

  2. 3

  3. 2

  4. none of the above


Correct Option: C

A function may return a reference or a pointer variable also.

  1. True

  2. False


Correct Option: A

Which one of the following error handling functions of ios class returns true, when an input or an output operation on file has failed?

  1. bad()

  2. good()

  3. eof()

  4. fail()


Correct Option: D
  • is also called the _________.
  1. address of operator

  2. reference operator

  3. value operator

  4. indirection operator


Correct Option: D

State, if the following comment is valid or not. /* An apple /* a day keeps */ the doctor away */

  1. Valid

  2. Invalid


Correct Option: B

Is it important to define a virtual function in a base class even though it may not be used?

  1. Yes

  2. No


Correct Option: A

When a derived class is the base class of some other class, then this type of inheritance is known as ___________.

  1. hierarchical inheritance

  2. multiple inheritance

  3. multilevel inheritance

  4. hybrid inheritance


Correct Option: C

What is the output of the following program?#include void main() { int x=7,y=6,z; z=x-- -y; cout< }

  1. 1

  2. 0

  3. -1

  4. None of the above


Correct Option: A

Suppose p, q, r are integer variables with value 10, 20, 30 respectively. What will be the value of the following expression? ! ((q+r)>(r-10))

  1. 0

  2. 1

  3. -1

  4. None of the above


Correct Option: A

What is the output of the following expression? int a=16,b= -8; cout<

  1. 1

  2. 0

    • 1
  3. 0.0


Correct Option: B

What would be the output, if the input given to 'a' is Ram Krishan Verma?#include<iostream.h> void main() { char a[10]; cin.getline(a,10); cout<<a; }

  1. Ram Krish

  2. Ram Krisha

  3. Ram Krishan

  4. Ram Krishan Verma


Correct Option: A

The following expression evaluates to the value _____. 0 + 1 * 3 - 1 * 5

  1. 10

  2. -10

  3. -2

  4. 2


Correct Option: C

An object pointer can point to private members of a class.

  1. True

  2. False


Correct Option: B

Which one of the following file modes allows us to add data or to modify the existing data anywhere in the file?

  1. ios::app

  2. ios::ate

  3. ios::out

  4. ios::trunc


Correct Option: B

What will be the output of the following program? void main() { int z[]={5,6,7,8,9,10}; int *p; p=z; cout<<*p+1; }

  1. Base address of z

  2. 5

  3. 6

  4. Unknown value


Correct Option: C

What is the output of the following expression? int a=16,b= -8; cout<

  1. 1

  2. 0

  3. -1

  4. 0.0


Correct Option: B

How many types of storage classes are there in C++?

  1. 4

  2. 5

  3. 3

  4. None of the above


Correct Option: A

External variable is automatically initialized to ___________.

  1. 0

  2. 1

  3. -1

  4. None of the above


Correct Option: A

How many times will the following statement be executed?void main() { int a; a=100; while(a>=100) { cout<< hello ; --a; } }

  1. Never

  2. Once

  3. 100

  4. 99


Correct Option: B

Which function in a stream sets the current get position?

  1. seekg()

  2. seekp()

  3. get()

  4. tellg()


Correct Option: A

What is the output of the following program? #include<iostream.h> void main() { enum birds{parrot,crow,pigeon,sparrow}; birds b=pigeon; cout<<b; }

  1. pigeon

  2. 3

  3. 2

  4. none of the above


Correct Option: C

What will be the output of the following program?

void main()

{
int p,q,r;
p=10;
q=20;
r=30;
if ((p>10)||(q<30))
if(r>p)
cout<<”Wintern”;
else if((p<q)&&(r<20))
cout<<”Summern”;
cout<<”Autumn”;}

  1. Winter Autumn

  2. Autumn

  3. Summer Autumn

  4. Winter


Correct Option: A

What is the output of the following program? void main() { int z[]={5,6,7,8,9,10}; int *p; p=z; cout<<*p+1; }

  1. Base address of z

  2. 5

  3. 6

  4. None of the above


Correct Option: C

What is the output of the following program? void main() { int m=10; int *p=&m; (*p)++; cout<<(*p)++; }

  1. 12

  2. 11

  3. 10

  4. Address of m


Correct Option: B

What will be the output of the following program?#include<iostream.h> class sun { public: void result() { cout<< class sun ; } }; class moon { public: void result() { cout<< class moon ; } }; class stars:public sun,public moon { public: void show() { cout<< class stars ; } }; void main() { stars s; s.result(); }

  1. class stars

  2. class moon

  3. class sun

  4. none of the above


Correct Option: D

What will be the output of the following program? #include<iostream.h> class sun { public: void result() { cout<< class sun ; } }; class moon { public: void result() { cout<< class moon ; } }; class stars:public sun,public moon { public: void show() { cout<< class stars ; } }; void main() { stars s; s.result(); }

  1. class stars

  2. class moon

  3. class sun

  4. none of the above


Correct Option: D

Which one of the following languages is not an object oriented programming language?

  1. Ada

  2. Smalltalk

  3. Java

  4. Object Pascal


Correct Option: A

By default, the members of a structure are __________.

  1. private

  2. public

  3. protected

  4. none of these


Correct Option: B

External variable is automatically initialized to ___.

  1. 0

  2. 1

  3. -1

  4. none of the above


Correct Option: A
- Hide questions