Anonymous user
Integer comparison: Difference between revisions
→{{header|C++}}: Idiomatic C++ does not include "using namespace std"
(Kotlin entry) |
(→{{header|C++}}: Idiomatic C++ does not include "using namespace std") |
||
Line 415:
=={{header|C++}}==
<lang cpp>#include <iostream>
int main()
{
int a, b;
std::cin >> a >> b;
// test for less-than
if (a < b)
std::cout << a << " is less than " << b <<
// test for equality
if (a == b)
std::cout << a << " is equal to " << b <<
// test for greater-than
if (a > b)
std::cout << a << " is greater than " << b <<
}</lang>
|