1
Q:

What is the output of this program ?

       #include
        using namespace std;
        int n(char, int);
        int (*p) (char, int) = n;
        int main()
        {
            (*p)('d', 9);
            p(10, 9);
            return 0;
        }
        int n(char c, int i)
        {
            cout << c <<  i;
            return 0;
        }

A) d99 B) d9d9
C) d9 D) compile time error

Answer:   A) d99



Explanation:

In this program, we have declared the values as integer instead of character, So it is printing as d99 but it will not arise an error.

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 3578
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 3749
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 4249
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 3831
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 4667
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 3118
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 6629