1- What will be the output after executing the following code? 3 marks
class c1{
public:
virtual void function(){
cout”I am in c1”endl;
}
};
class c2: public c1{
public:
void function(){
cout”I am in c2”endl;
}
};
class c3: public c1 {
public:
void function(){
cout”I am in c3”endl;
}
};
int main(){
c1 * test1 = new c2();
c1 * test2 = new c3();
test1->function();
test2->function();
system(“PAUSE”);
return 0;
}
2- How to implement abstraction in c++.
3- How to declare friend function , write structure.
Mcqs kush new the kush old papers mai se , aur 12 short question mai se 8 coding wale the , 3 mai batna tha ke is code ka output kiya hai , ek question tha jis mai "-" operator ko override karna tha , aur is ka final code lakhana tha.
Baki ALLAH kare aap sub ke papers ache se ho jaye ameen.
0 comments
Post a Comment