Discussion :: Objects and Classes
-
What will be the output of the following program?
#include class GateBase { public: float x; }; class GateDerived : public GateBase { public: char ch; void Process() { ch = (int)((x=12.0)/3.0); } void Display() { coutint)ch; } }; int main() { class GateDerived *objDev = new GateDerived; objDev->Process(); objDev->Display(); return 0; }
|
A.
The program will print the output 4. |
|
B.
The program will print the ASCII value of 4. |
|
C.
The program will print the output 0. |
|
D.
The program will print the output garbage. |
Answer : Option A
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook