1
Q:

What is the output of this program?

#include
        using namespace std;
        struct sec {
            int a;
            char b;
        };
        int main()
        {
            struct sec s ={25,50};
            struct sec *ps =(struct sec *)&s;
            cout << ps->a << ps->b;
            return 0;
        }

A) 252 B) 253
C) 254 D) 262

Answer:   A) 252



Explanation:

In this program, We are dividing the values of a and b, printing it.

Subject: C++
Q:

Explain storage qualifiers in C++

Answer

i.) Const - This variable means that if the memory is initialised once, it should not be altered by a program. 


ii.) Volatile - This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents. 


iii.) Mutable - This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is constant.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

1 3577
Q:

Where does the allocaters are implemented?

A) Template library B) Standard library
C) C++ code library D) None of these
 
Answer & Explanation Answer: B) Standard library

Explanation:

Allocaters are implemented in C++ standard library but it is used for C++ template library.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3748
Q:

How the different permutations are ordered in c++?

A) Compare lexicographicaly to each other elements B) By finding the highest element in the range
C) By finding the lowest element in the range D) None of the mentioned
 
Answer & Explanation Answer: A) Compare lexicographicaly to each other elements

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 4248
Q:

Which keyword is used to declare the min and max functions?

A) iostream B) string
C) algorithm D) None of these
 
Answer & Explanation Answer: C) algorithm

Explanation:

Algorithm header file contain the supporting files needed for the execution of these functions.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 7316
Q:

What is meant by heap?

A) Used for fast reterival of elements B) Used for organising the elements
C) Both a & b D) None of the mentioned
 
Answer & Explanation Answer: C) Both a & b

Explanation:

A heap is a way to organize the elements of a range that allows for fast retrieval of the element.

Report Error

View Answer Report Error Discuss

Filed Under: C++

2 3830
Q:

What is the kind of execution does sequence point allow?

A) Non-overlap B) Overlap
C) Concurrent D) None of these
 
Answer & Explanation Answer: A) Non-overlap

Explanation:

To resolve all the side-effects in the program, the sequence point should not be overlapped.

Report Error

View Answer Report Error Discuss

Filed Under: C++

2 4666
Q:

What kind of object is modifying sequence algorithm?

A) Function template B) Class template
C) Method D) None of these
 
Answer & Explanation Answer: A) Function template

Explanation:

It is a group of functions and implemented under algorithm header file.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3115
Q:

How many parameters are present in mismatch method in non-sequence modifying
algorithm?

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: D) 4

Explanation:

There are four parameters. They are first1, last1, first2, predicate.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 6628