Integer comparison: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 2: | Line 2: | ||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
<ada> |
<lang ada> |
||
with Ada.Text_IO; use Ada.Text_IO; |
with Ada.Text_IO; use Ada.Text_IO; |
||
with Ada.Integer_Text_IO; use Ada.Integer_Text_Io; |
with Ada.Integer_Text_IO; use Ada.Integer_Text_Io; |
||
Line 27: | Line 27: | ||
end if; |
end if; |
||
end Compare_Ints; |
end Compare_Ints; |
||
</ |
</lang> |
||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
Line 142: | Line 142: | ||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
<csharp>using System; |
<lang csharp>using System; |
||
class Program |
class Program |
||
Line 157: | Line 157: | ||
Console.WriteLine("{0} is greater than {1}", a, b); |
Console.WriteLine("{0} is greater than {1}", a, b); |
||
} |
} |
||
}</ |
}</lang> |
||
=={{header|Clean}}== |
=={{header|Clean}}== |
||
Line 282: | Line 282: | ||
=={{header|J}}== |
=={{header|J}}== |
||
Comparison is accomplished by the verb < |
Comparison is accomplished by the verb <tt>compare</tt>, which provides logical-numeric output.<br>Text elaborating the output of <tt>compare</tt> is provided by <tt>cti</tt>: |
||
compare =: <,=,> |
compare =: <,=,> |
||
Line 432: | Line 432: | ||
=={{header|OCaml}}== |
=={{header|OCaml}}== |
||
<ocaml> |
<lang ocaml> |
||
let my_compare a b = |
let my_compare a b = |
||
if a < b then "A is less than B" |
if a < b then "A is less than B" |
||
Line 443: | Line 443: | ||
and b = read_int () in |
and b = read_int () in |
||
print_endline (my_compare a b) |
print_endline (my_compare a b) |
||
</ |
</lang> |
||
=={{header|Oz}}== |
=={{header|Oz}}== |