Home
Current Affairs January 2024

What is the correct answer?

4

Which of the following is a valid destructor of the class name "Country"

A. int ~Country()

B. void Country()

C. int ~Country(Country obj)

D. void ~Country()

Correct Answer :

B. void Country()


Related Questions

What is the correct answer?

4

When is std::bad_alloc exception thrown?

A. When new operator cannot allocate memory

B. When alloc function fails

C. When type requested for new operation is considered bad<  thisexception is thrown

D. When delete operator cannot delete teh allocated (corrupted) object

What is the correct answer?

4

Which classes allow primitive types to be accessed as objects?

A. Storage

B. Virtual

C. Friend

D. Wrapper

What is the correct answer?

4

Bitwise operators can operate upon?

A. double and chars

B. floats and doubles

C. ints and floats

D. ints and chars

What is the correct answer?

4

gets() and puts() are unformatted I/O functions.

A. True

B. False

What is the correct answer?

4

Which one of the following is not a fundamental data type in C++

A. float

B. string

C. int

D. wchar_t

What is the correct answer?

4

Which of the following expressions is wrong

A. float a =123.56;

B. char ch ='T' * 'A';

C. char ch ='T' *20;

D. 3 +a = b;

What is the correct answer?

4

The contents of a file opened in 'r+' mode cannot be changed.

A. True

B. False

What is the correct answer?

4

# define PI = 8;' is the correct declaration of macros.

A. True

B. False

What is the correct answer?

4

emp name' is a valid variable name.

A. True

B. False

What is the correct answer?

4

The -------------------------- loop executes at least once.

A. for

B. while

C. do-while

D. while & do-while

What is the correct answer?

4

The function fopen() on failure returns---------------------.

A. 0

B. NULL

C. 1

D. none of the above

What is the correct answer?

4

unsigned' is a valid variable name.

A. True

B. False

What is the correct answer?

4

What is an array?

A. An array is a collection of variables that are of the dissimilar data type.

B. An array is a collection of variables that are of the same data type.

C. An array is not a collection of variables that are of the same data type.

D. None of the above.

What is the correct answer?

4

The output of the following code is:
void main()
{
int z, a = 5, b = 3; z = a * 2 + 26 % 3;
printf("%d", z); }

A. 10

B. 0

C. 12

D. None of the above

What is the correct answer?

4

printf("%d", sizeof('2')); will print 2.

A. True

B. False

What is the correct answer?

4

The main() function can call itself recursively.

A. True

B. False

What is the correct answer?

4

Which of the following is not an infinite loop

A. int i =1;
while (1)
{i++;}

B. for( ; ; );

C. int true=0< false;
while (true)
{false = 1;}

D. int y, x = 0;
do
{y = x;}
while (x==0);

What is the correct answer?

4

Which of the following is a valid destructor of the class name "Country"

A. int ~Country()

B. void Country()

C. int ~Country(Country obj)

D. void ~Country()

What is the correct answer?

4

------ is the ternary operator

A. ?,-

B. ?,:

C. ++<--

D. none of the above

What is the correct answer?

4

Operation between an integer and float always yields a float result.

A. True

B. False

What is the correct answer?

4

Which one of the following is not a valid reserved keyword in C++

A. Explicit

B. Public

C. Implicit

D. Private

What is the correct answer?

4

The statement "for (i = 0, j = 2; j <= 10; j++)" is a valid statement in 'C'.

A. True

B. False

What is the correct answer?

4

An array elements are always stored in _________ memory locations.

A. Sequential

B. Random

C. Sequential and Random

D. None of the above

What is the correct answer?

4

Which of the STL containers store the elements contiguously (in adjecent memory locations)?

A. std::vector

B. std::list

C. std::map

D. std::set

What is the correct answer?

4

struct stud
{
int roll;
char name[20];
float marks;
} *p;
What will be the byte size of p?

A. 24

B. 2

C. 26

D. None

What is the correct answer?

4

The expression (i + j)++ is illegal.

A. True

B. False

What is the correct answer?

4

static variable will not always have assigned value.

A. True

B. False

What is the correct answer?

4

The output of the following code is:
void change (char *k) 
{
k="Hello";
return;
}
main()
{
char *ch = "World";;
change(ch);
printf("%s", ch);
}

A. Hello

B. World

C. Compilation error

D. Hello World

What is the correct answer?

4

Which of the following is the most preferred way of throwing and handling exceptions?

A. Throw by value and catch by reference.

B. Throw by reference and catch by reference.

C. Throw by value and catch by value

D. Throw the pointer value and provide catch for teh pointer type.

What is the correct answer?

4

A recursive function calls itself again and again.

A. True

B. False