Here's my code:
class Division{
public:
void div(){
//This is what to use inside the main
//Division Divide;
//Divide.div();
int x;
int y;
int div;
cout << "Still in Alpha So it only rounds the Number\n";
cout << "Enter Your Number\n";
cin >> x;
cout << "Divided by\n";
cin >> y;
cout << "=";
div = x/y;
cout << div;
You can't if you define them as int
. Try with double
or float
instead.
double x;
double y;
double div;
Changing the definition solves the problem.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments