Calculate Median from given values of Mean and Mode

Given two integers mean and mode, representing the Mean and Mode of a random group of data, the task is to calculate the median of that group of data.Input: mean = 3, mode = 6Output: 4Input: mean = 1, mode = 1Output : 1Approach: The given problem can be solved by using the mathematical relationship between mean, mode, and median of the group of data. Below is the relationship among them:=> => Therefore, the idea is to use the above formula to find the median of the data when the mean and the mode are given.Below is the implementation of the above approach:C++  #include using namespace std;  void findMedian(int Mean, int Mode){        double Median = (2 * Mean + Mode) / 3.0;          cout