#include <iostream>
double GetPercentage(float num1, float num2) {
return (num1 / num2) * 100.0;
}
int main(void) {
std::cout << "30 is " << GetPercentage(30, 40) << "% of 40" << "\n";
std::cout << "40 is " << GetPercentage(40, 30) << "% of 30" << "\n";
std::cout << "20 is " << GetPercentage(20, 35) << "% of 35";
}
/*
run:
30 is 75% of 40
40 is 133.333% of 30
20 is 57.1429% of 35
*/