I'm trying to do a arithmetic calculator when the user input 2 4-digit integer.
However, whenever i'm trying to get the division with reminder I'm not able to do so.
int main()
{
int firstNo, secondNo;
cout << "Enter two no-zero 4-digits integers:" << endl;
cout << endl;
cin >> firstNo >> secondNo;
cout << endl;
//obtain last value
int firstDigit = firstNo % 10;
int secondDigit = secondNo % 10;
int addfirstNumbers = firstDigit + secondDigit;
int minusfirstNumbers = firstDigit - secondDigit;
int multiplefirstNumbers = firstDigit * secondDigit;
int modfirstNumbers = firstDigit % secondDigit;
double divfirstNumbers = firstDigit / secondDigit;
cout <<"divfirstNumbers"; //gives me an integer
}
P.S : I'm purposely this calculator in long way. I do know that it is possible to do this calculator the shorter way via a for loop or a while function.
But the main thing here is i'm trying to get the value from the division with the reminder but however, I'm only getting the integer as I'm dividing the value based on integer.