0

Masters of Computer Applications (C++)

Description: Free online study material for MCA Entrance Exam covers notes and and practice materials, you can get the study material of all languages like C, C++, JAVA, Information Technology
Number of Questions: 30
Created by:
Tags: MCA MCA Entrance Masters in Computer Applications BCA Application Programming C C++ Java IT Information Technology Programming
Attempted 0/30 Correct 0 Score 0

By default, which value is assigned to enumerated data type?

  1. 0

  2. 1

  3. -1

  4. None of the above


Correct Option: A

The program which we write in the edit window is known as ______.

  1. object file

  2. source file

  3. executable file

  4. none of these


Correct Option: B

In inheritance, when a protected member is inherited in public mode, it becomes ______ in the derived class.

  1. public

  2. private

  3. protected

  4. none of these


Correct Option: C

What is the output of the following program? void main() { int z=-1; cout<<z+5<< , <<z+3<< , <<z; }

    • 5, - 2, - 2
    • 5, - 7, - 1
  1. 15, 18, 18

    • 15, - 18, - 18

Correct Option: B

Member functions can be defined

  1. outside the class definition

  2. inside the class definition

  3. both inside & outside the class definition

  4. none of the above


Correct Option: C

How many types of inheritance are there?

  1. 4

  2. 5

  3. 3

  4. 6


Correct Option: B

What type of error is encountered when the following program is executed?

#include<iostream.h> void mail() { cout<< have a nice day ; }

  1. Runtime error

  2. Compiler error

  3. Linker error

  4. Syntax error


Correct Option: C

What is the output of the following program? void main(); { int a=5,b=5; cout<<a++; cout<< -> ; cout<<++a; cout<< -> ; cout<<b++; }

  1. 5->7->6

  2. 6->7->5

  3. 5->7->5

  4. None of the above


Correct Option: D

The arrow operator accesses structure member via a pointer to object

  1. True

  2. False


Correct Option: A

What is the use of linker?

  1. Linker combines the object files into a single executable program.

  2. Linker converts the source file into object file.

  3. Linker converts the source file into executable file.

  4. None of the above


Correct Option: A

Which one of the following is a scope resolution operator?

  1. ->

  2. :

  3. &&

  4. ::


Correct Option: D

The function 'fputs' is declared in which header file?

  1. stdlib.h

  2. process.h

  3. stdio.h

  4. dos.h


Correct Option: C

The function 'isascii' is declared in which header file?

  1. dos.h

  2. stdlib.h

  3. alloc.h

  4. ctype.h


Correct Option: D

Is the following definition valid? int array1={34,69};

  1. Yes

  2. No


Correct Option: B

Give output of the following int i=1,j=1; j++; if (i==11) cout<<' its eleven' ; else cout<<' its not eleven ';

  1. its eleven

  2. its not eleven

  3. Neither 1 or 2

  4. Data insufficient


Correct Option: B

How many levels of accessibility are offered by classes?

  1. 2

  2. 3

  3. 4

  4. None of the above


Correct Option: B

Virtual functions enable the possibility for a function to be polymorphic when it is overridden in one or more inherited classes.

  1. True

  2. False


Correct Option: A

Element 'myarray[4]' is which element of the array?

  1. Fourth

  2. Fifth

  3. Third

  4. None of the above


Correct Option: B

What is the output of the following program? #include<iostream.h> void fun(int &a,int &b) { a=a*b; b=b-a; a=a-b; } void main() { int a=6,b=30; fun(a,b); cout<<a<< , <<b; }

  1. -330,150

  2. 330, -150

  3. -150, -330

  4. 6, 30


Correct Option: B

Which of the following is true about the static member variable?

  1. It is initialized to 0 when the first object is created.

  2. It is visible outside the class also.

  3. Every time an object is created, it is initialized to 1.

  4. None of the above


Correct Option: A

Select wildcard characters from the following?

    • , *
  1. ? , .

    • , #
  2. ? , *


Correct Option: D

Which one of the following can't be used as variable name?

  1. virtual

  2. assignment

  3. pointer

  4. object


Correct Option: A

Which one of the following is not a de-referencing operator?

  1. .*

  2. *

  3. ::*

  4. ::


Correct Option: D

Give output of the following, if the input given is 'a'. cin>>choice; switch(choice) { case ' b' :cout<< banana ; break; case ' a' :cout<< apple ; case ' g' :cout<< grapes ; default :cout<< invalid choice ; }

  1. applegrapesinvalid choice

  2. applegrapesinvalid choicebanana

  3. apple

  4. none of these


Correct Option: A

The operator << is called the ______________.

  1. extraction operator

  2. insertion operator

  3. get from operator

  4. put to operator


Correct Option: D

What is the output of the following program? #include<iostream.h> static int j=10; void value() { static int j=40; cout<< now= <<j<< , ; } void value() { static int j=5; value(); cout<< next= <<j; }

  1. now = 5, next = 5

  2. now = 40, next = 5

  3. now = 10, next =10

  4. now = 40, next = 10


Correct Option: B

Which one of the following operators can't be overloaded?

  1. ::

  2. +

  3. +=

  4. []


Correct Option: A

Which one of the following statements is incorrect about friend functions?

  1. Declaration of a friend function in private or public section makes a difference to its meaning.

  2. It lies outside the scope of a class to which it is a friend.

  3. Unlike member functions, it can't access member names directly.

  4. It can be invoked without the help of any object.


Correct Option: A

Which one of the following is a default constructor? A. class star { private: int a; public: star(int a) { a=0; } }

B. class star { private: int a; public: star() { a=0; } } C. class star { private: int a,b; public: star(int a,int b) { a=0; b=0; } }

  1. A

  2. B

  3. C

  4. None of these


Correct Option: B

Justify: cout<<++x; cout<< , ; cout<<++y; cout<< , ; cout<<- x; cout<< , ; cout<<y++; }

  1. 5, 1, 4, 11

  2. 5, 1, 4, 1

  3. 5, 1, 3, 11

  4. 5, 1, 4, 1


Correct Option: D
- Hide questions