C++

Description: C++ Programming Language Concepts for for MCA Entrance and Information Technology Placement Papers
Number of Questions: 25
Created by:
Tags: Computer Information Technology Placement Papers C++ Programming Language Concepts MCA Entrance C++ Basic Concepts C Basic Concepts Programming Fundamentals of Computer Programming Computer Basics
Attempted 0/24 Correct 0 Score 0

A function can also return an object.

  1. True

  2. False


Correct Option: A

Inline functions make a program run faster because the overhead of a function call & return is eliminated.

  1. True

  2. False


Correct Option: A

State whether the following function declaration with default values is valid or not? int sum (int a=10,int b);

  1. Valid

  2. Invalid


Correct Option: B

Which one of the following is a user defined data type?

  1. Array

  2. Pointer

  3. Union

  4. Function


Correct Option: C

A protected member inherited in a public mode becomes _____________.

  1. public

  2. private

  3. protected

  4. none of these


Correct Option: C

Which one of the following statements is incorrect about static member functions?

  1. A static function can have access to only other static members declared in the same class.

  2. A static function can be called using the class name instead of its objects.

  3. The keyword static is used before the function name.

  4. None of the above.


Correct Option: D

The size of operator is a __________ operator.

  1. uniry

  2. binary

  3. logical

  4. relational


Correct Option: A

Given the following definition: int i=10; int *p; Which of the following assignments is invalid?

  1. i=*p

  2. *p=i

  3. p=&i

  4. *p=&i


Correct Option: D

An object is a self-contained abstraction of an item.

  1. True

  2. False


Correct Option: A

What will be the output for the following? #include<iostream.h> { int x[6]={62,45,7,10,82,90}; cout<<*x; }

  1. 62

  2. 0

  3. 1

  4. 6


Correct Option: C

There are certain rules that must be followed during function calls, which are listed below. Read them carefully & find out which one of them is incorrect.

  1. Sequences of actual & formal parameters may differ.

  2. Numbers of actual & formal parameters must be the same.

  3. Types of actual & formal parameters must be the same.

  4. None of these


Correct Option: A

The variables which are associated with function name during function call are called _________.

  1. local variables

  2. formal variables

  3. global variables

  4. actual variables


Correct Option: D

Name the header file which is needed for the functions like read() and open()?

  1. iomanip.h

  2. stdio.h

  3. fstream.h

  4. iostream.h


Correct Option: C

What will be the output for the following? int i=2; if(i) cout<<i++; else cout<< --i;

  1. 2

  2. 1

  3. 3

  4. 0


Correct Option: A

Polymorphism means a function with one name & many forms.

  1. True

  2. False


Correct Option: A

Destructors has the same name as that of a class, but with a prefix ' ~'.

  1. True

  2. False


Correct Option: A

Till the array elements are not given any specific values, they are supposed to contain garbage values.

  1. True

  2. False


Correct Option: A

What will be the output for the following? enum color{pink,yellow,blue,black}; #include<iostream.h> void main() { cout<<blue; cout<<black; }

  1. Blue Black

  2. 3 4

  3. 2 3

  4. None of the above


Correct Option: C

Array elements are always stored in contiguous memory locations.

  1. True

  2. False


Correct Option: A

Give the output for the following: #include int g=10; void fun(int &x,int y) { x=x-y; y=x*10; cout<<x<<,<<y; } void main() { int g=5; fun(::g,g); }

  1. 0, 0

  2. -5, -50

  3. 10, 50

  4. 5, 50


Correct Option: D

Consider the following program & name the base class & the derived class. #include class A { int a; public: void getdata(); void putdata(); }; class B { int b; public: void cal(); }; class C: public A,B { public: void show(); };

  1. Base class-B Derived class-C

  2. Base class-A & B Derived class-C

  3. Base class-A Derived class-B & C

  4. Base class-A Derived class-C


Correct Option: B

The closing braces of structure are followed by a __________.

  1. colon

  2. dot

  3. semicolon

  4. none of the above


Correct Option: C

How many values can be returned by a function?

  1. 1

  2. 0

  3. Multiple

  4. They don't return any value


Correct Option: A

C++ allows us to declare a variable anywhere in the program.

  1. True

  2. False


Correct Option: A
- Hide questions