Anonymous user
Integer comparison: Difference between revisions
→[[Comparing_two_integers#ALGOL 68]]
Line 30:
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Standard - no extensions to language used}}
main: (▼
Note: the standard includes the characters "≤", "≥" and "≠". These appear
in the character sets [[wp:ALCOL]], [[wp:GOST 10859]], [http://www.w3.org/TR/REC-MathML/chap6/ISOTECH1.html ISOtech] and
IBM's [[:wp:EBCDIC]] code pages e.g. [http://www-01.ibm.com/software/globalization/cs/cs01340.jsp code page 1340].
IF a < b THEN▼
{{works with|ALGOL 68G|Any - tested with release mk15-0.8b.fc9.i386}}
printf(($g" is less than "gl$, a, b))▼
{{works with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release 1.8.8d.fc9.i386}}
ELIF a = b THEN▼
The current distribution of both [[ALGOL 68G]] and [[ELLA ALGOL 68]] compilers only
printf(($g" is equal to "gl$, a, b))▼
allow [[wp:ASCII]] characters (ASCII has neither "≤", "≥" nor "≠" characters).
ELIF a > b THEN▼
printf(($g" is greater than "gl$, a, b))▼
INT
read((a, space, b, new line));
IF a <= b OR a LE b # OR a ≤ b # THEN
print((a," is less or equal to ", b, new line))
FI;
FI;
IF a /= b OR a NE b # OR a ≠ b # THEN
print((a," is not equal to ", b, new line))
FI;
IF a >= b OR a GE b # OR a ≥ b # THEN
print((a," is greater or equal to ", b, new line))
FI
)</pre>
Example output:
<pre>
3 4
+3 is less or equal to +4
+3 is less than +4
+3 is not equal to +4
</pre>
=={{header|AWK}}==
|