Functions

Q1: What will be the output of the following program?
#include<iostream.h> 
class Aptitude
{
    int x, y; 
    public:
    void show(void);
    void main(void);
};
void Aptitude::show(void)
{ 
    Aptitude b;
    b.x = 2;
    b.y = 4;
    cout<< x << ' ' << y;
}
void Aptitude::main(void)
{
    Aptitude b;
    b.x = 6; 
    b.y = 8;
    b.show();
}
int main(int argc, char *argv[])
{
    Aptitude run;
    run.main();
    return 0; 
}

A 2 4

B 6 8

C The program will report error on Compilation.

D The program will report error on Linking.

E The program will report error on Run-time.

ANS:B - 6 8

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.