3
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:

What is the user-defined header file extension in c++?

A) cpp B) h
C) hf D) none of these
 
Answer & Explanation Answer: B) h

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 6350
Q:

What is the general syntax for accessing the namespace variable?

A) namespaceid::operator B) namespace,operator
C) namespace#operator D) none of the mentioned
 
Answer & Explanation Answer: A) namespaceid::operator

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 11973
Q:

What is the use of Namespace?

A) To encapsulate the data B) To structure a program into logical units.
C) Both a and b D) none of these
 
Answer & Explanation Answer: B) To structure a program into logical units.

Explanation:

The main aim of the namespace is to understand the logical units of the program and to make the program so robust.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3675
Q:

How many types of modularization are there in c++?

A) 4 B) 3
C) 1 D) none of these
 
Answer & Explanation Answer: D) none of these

Explanation:

There are two types of modular programming.They are interface and implementation.

Report Error

View Answer Report Error Discuss

Filed Under: C++

6 10642
Q:

How many types of macros are there in c++?

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

Explanation:

There are two types of macros. They are object-like and function-like.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 7035
Q:

which keyword is used to define the macros in c++?

A) macro B) define
C) #define D) none of these
 
Answer & Explanation Answer: C) #define

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 5275
Q:

What are the mandatory part to present in function pointers?

A) & B) retrun values
C) data types D) none of these
 
Answer & Explanation Answer: C) data types

Explanation:

The data types are mandatory for declaring the variables in the function pointers.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 7651
Q:

What is the default return type of a function ?

A) int B) void
C) float D) char
 
Answer & Explanation Answer: B) void

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

21 17287