Q&A Discussions
#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 Votes
1 AnswerMatt reaches the final round of a treasure hunt. In this, he finds that as he proceeds there are flags with the number written on them at different positions. The difference between two consecutive flags can be either a or b. If he finds the number on the first flag is 0. Given three integer, first one is number of flags present, second is a and third is b. then return all the possible values for last flag for each test case.
hunt({3 1 2}) = {2 3 4}
0 Votes
2 Answersusing a while loop create a guessing game program that keeps asking the user to enter a number until the user enters the number 7. You will need to create and initialise an int variable to zero. You can then use this variable as the condition in your while loop ( while the number is not equal to seven) Then in the while loop ask the user to enter a number and store the number entered in the number variable that is in the conditions of your loop.
0 Votes
1 AnswerHot today
Sticky position
2 Votes
Help please?
3 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes
Game development
0 Votes
Ruby programming?
3 Votes