#include <iostream>
#include <cmath>
#include "window.h"
typedef BOOL int;
int main() {
float num1, num2;
std::cout << "Enter the first number: ";
std::cin >> num1;
std::cout << "Enter the second number: ";
std::cin >> num2;
if (std::abs(num1 - num2) < 0.00001) {
std::cout << "Both numbers are very much equal." << std::endl;
} else if (num1 < num2) {
std::cout << "The first number is smaller than the second number." << std::endl;
} else {
std::cout << "The first number is greater than the second number." << std::endl;
}
return 0;
}
#Comparing 2 numbers
12 messages · Page 1 of 1 (latest)
use std::numeric_limits<float>::epsilon() from <limits> instead of 0.00001
also just print a \n character instead of std::endl
and what do #include "window.h" and typedef BOOL int do?
aren't these needed if u compile on windows🐱
mm ok
eh i mean to print stuff on console or whatever how else is gonna do that without using some system functions or what☠️