I am trying to make a simple program that tests the users ability to divide 2 numbers without a remainder. For some reason even if you type in the the correct answer the program doesnt acknowledge it. The code below should show you what i mean.
Code:
#include<iostream>
using namespace std;
int main(void)
{
float num1 = 112.0f / 9.0f; // = 12.4444
float num2 = 12.4444f;
cout << num1 << '\n'
<< num2 << '\n';
if(num1 == num2) // why doesnt num1 == num2
{
cout << "yeah\n";
}
return(0);
}
how do i make num1 == num2?
Thanks.