Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C++ Programming
»
Functions
What will be the output of the following program? #include<iostream.h> class Tab { int x, y; public: void show(void); void main(void); }; void Tab::show(void) { Tab b; b.x = 2; b.y = 4; cout<< x << " " << y; } void Tab::main(void) { Tab b; b.x = 6; b.y = 8; b.show(); } int main(int argc, char *argv[]) { Tab run; run.main(); return 0; }
2 4
6 8
The program will report error on Compilation.
The program will report error on Linking.
The program will report error on Run-time.
Show Answer
Correct Answer:
6 8
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment