INTCOMP  PROLOG
*                            Reg1=Addr(Addr(argA),Addr(argB))
         L     2,0(1)        Reg2=Addr(argA)
         L     3,4(1)        Reg3=Addr(argB)
         L     4,0(2)        Reg4=argA
         L     5,0(3)        Reg5=argA
         ST    4,A           Store R4 in A
         ST    5,B           Store R5 in B
*                            if (A < B)
         L     0,A           load R0
         C     0,B           compare
         BL    LOWER         branch if lower
*                            if (A = B)
         L     0,A           load R0
         C     0,B           compare
         BE    EQUAL         branch if equal
*                            if (A < B)
         L     0,A           load R0
         C     0,B           compare
         BH    GREATER       branch if higher
*                            other case ?
         B     RETURN
LOWER    WTO   'A<B'
         B     RETURN
EQUAL    WTO   'A=B'
         B     RETURN
GREATER  WTO   'A>B'
         B     RETURN
*
RETURN   EPILOG
A        DS    F             31-bit signed integer
B        DS    F             31-bit signed integer
         END


Compare		PHA			;push Accumulator onto stack
		JSR GetUserInput	;routine not implemented
		;integers to compare now in memory locations A and B
		LDA A
		CMP B			;sets flags as if a subtraction (a - b) had been carried out
		BCC A_less_than_B	;branch if carry clear
		BEQ A_equals_B		;branch if equal
		;else A greater than B
		JSR DisplayAGreaterThanB;routine not implemented
		JMP Done
A_less_than_B:	JSR DisplayALessThanB	;routine not implemented
		JMP Done
A_equals_B:	JSR DisplayAEqualsB	;routine not implemented
Done:		PLA			;restore Accumulator from stack
		RTS			;return from subroutine


compare:
	push psw
	cjne a, b, clt
	; a == b
	; implement code here
	jmp compare_
clt:
	jc lt
	; a > b
	; implement code here
	jmp compare_
lt:
	; a < b
	; implement code here
compare_:
	pop psw
	ret


: compare \ n m --
  2dup n:= if "They are equal" . cr then
  2dup n:< if "First less than second" . cr then
  n:> if "First greater than second" . cr then ;


.equ STDOUT, 1
.equ SVC_WRITE, 64
.equ SVC_EXIT, 93

.text
.global _start

_start:
	stp x29, x30, [sp, -16]!
	mov x0, #123
	mov x1, #456
	mov x29, sp
	bl integer_compare // integer_compare(123, 456);
	mov x0, #-123
	mov x1, #-456
	bl integer_compare // integer_compare(-123, -456);
	mov x0, #123
	mov x1, #123
	bl integer_compare // integer_compare(123, 123);
	ldp x29, x30, [sp], 16
	mov x0, #0
	b _exit // exit(0);

// void integer_compare(long long x, long long y) - compare two signed integers and print a message
integer_compare:
	cmp x0, x1
	mov x0, #STDOUT
	b.eq 1f
	b.gt 2f
	// x < y
	ldr x1, =msg_lt
	mov x2, #17
	b _write
1:	// x == y
	ldr x1, =msg_eq
	mov x2, #16
	b _write
2:	// x > y
	ldr x1, =msg_gt
	mov x2, #20
	b _write

msg_lt:
	.ascii "x is less than y\n"
msg_eq:
	.ascii "x is equal to y\n"
msg_gt:
	.ascii "x is greater than y\n"
.align 4

//////////////// system call wrappers
// ssize_t _write(int fd, void *buf, size_t count)
_write:
	stp x29, x30, [sp, -16]!
	mov x8, #SVC_WRITE
	mov x29, sp
	svc #0
	ldp x29, x30, [sp], 16
	ret

// void _exit(int retval)
_exit:
	mov x8, #SVC_EXIT
	svc #0


report z_integer_comparison.

parameters: a type int4, b type int4.

data(comparison_result) = cond string(
  when a < b " can be replaced by a lt b
  then |{ a } is less than { b }|
  when a = b " can be replaced by a eq b
  then |{ a } is equal to { b }|
  when a > b " can be replaced by a gt b
  then |{ a } is greater than { b }| ).

write comparison_result.


PROC Main()
  INT a,b

  Print("Input value of a:") a=InputI()
  Print("Input value of b:") b=InputI()

  IF a<b THEN
    PrintF("%I is less than %I%E",a,b)
  FI
  IF a>b THEN
    PrintF("%I is greater than %I%E",a,b)
  FI
  IF a=b THEN
    PrintF("%I is equal to %I%E",a,b)
  FI
RETURN


with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_Io;

procedure Compare_Ints is
   A, B : Integer;
begin
   Get(Item => A);
   Get(Item => B);

   -- Test for equality
   if A = B then
      Put_Line("A equals B");
   end if;

   -- Test For Less Than
   if A < B then
      Put_Line("A is less than B");
   end if;

   -- Test For Greater Than
   if A > B then
      Put_Line("A is greater than B");
   end if;
end Compare_Ints;


void
output(integer a, integer b, text condition)
{
    o_integer(a);
    o_text(condition);
    o_integer(b);
    o_byte('\n');
}

integer
main(void)
{
    if (a < b) {
	output(a, b, " is less then ");
    }

    if (a == b) {
	output(a, b, " is equal to ");
    }

    if (a > b) {
	output(a, b, " is greater than ");
    }

    return 0;
}


main: (
  INT a, b;
  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;
  IF a < b OR a LT b THEN
    print((a," is less than ", b, new line))
  ELIF a = b OR a EQ b THEN
    print((a," is equal to ", b, new line))
  ELIF a > b OR a GT b THEN
    print((a," is greater than ", b, new line))
  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
)


begin

    integer a, b;

    write( "first  number: " );
    read( a );
    write( "second number: " );
    read( b );

    if a < b then write( a, " is less    than ", b );
    if a = b then write( a, " is equal   to   ", b );
    if a > b then write( a, " is greater than ", b );

end.


set n1 to text returned of (display dialog "Enter the first number:" default answer "") as integer
set n2 to text returned of (display dialog "Enter the second number:" default answer "") as integer
set msg to {n1}
if n1 < n2 then
	set end of msg to " is less than "
else if n1 = n2 then
	set end of msg to " is equal to "
else if n1 > n2 then
	set end of msg to " is greater than "
end if
set end of msg to n2
return msg as string


/* ARM assembly Raspberry PI  */
/*  program comparNumber.s   */

/* Constantes    */
.equ BUFFERSIZE,   100
.equ STDIN,  0     @ Linux input console
.equ STDOUT, 1     @ Linux output console
.equ EXIT,   1     @ Linux syscall
.equ READ,   3     @ Linux syscall
.equ WRITE,  4     @ Linux syscall
/* Initialized data */
.data
szMessNum1: .asciz "Enter number 1 : \n"
szMessNum2: .asciz "Enter number 2: \n"
szMessEqual: .asciz "Number 1 and number 2 are equals.\n"
szMessSmall: .asciz "Number 1 smaller than number 2.\n"
szMessLarge: .asciz "Number 1 larger than number 2.\n"
szCarriageReturn:  .asciz "\n"

/* UnInitialized data */
.bss
sBuffer:    .skip    BUFFERSIZE

/*  code section */
.text
.global main
main:                /* entry of program  */
    push {fp,lr}    /* saves 2 registers */
    ldr r0,iAdrszMessNum1 @ message address
    ldr r1,iAdrsBuffer   @ buffer address
    mov r2,#BUFFERSIZE
    bl numberEntry
    mov r5,r0               @ save number 1 -> r5
    ldr r0,iAdrszMessNum2  @ message address
	ldr r1,iAdrsBuffer   @ buffer address
	mov r2,#BUFFERSIZE
    bl numberEntry
	cmp r5,r0         @ compar number 1 and number 2
    beq equal
	blt small
	bgt large
	@ never !!
	b 100f
equal:
    ldr r0,iAdrszMessEqual    @ message address
	b aff
small:
    ldr r0,iAdrszMessSmall    @ message address
	b aff
large:
    ldr r0,iAdrszMessLarge    @ message address
	b aff
aff:
    bl affichageMess      @ display message

100:   /* standard end of the program */
    mov r0, #0                  @ return code
    pop {fp,lr}                 @restaur 2 registers
    mov r7, #EXIT              @ request to exit program
    swi 0                       @ perform the system call

iAdrszMessNum1:  .int szMessNum1
iAdrszMessNum2: .int  szMessNum2
iAdrszMessEqual: .int szMessEqual
iAdrszMessSmall: .int szMessSmall
iAdrszMessLarge: .int szMessLarge
iAdrsBuffer:   .int  sBuffer
iAdrszCarriageReturn:  .int  szCarriageReturn
/******************************************************************/
/*     Number entry with display message and conversion number    */
/******************************************************************/
/* r0 contains message address */
/* r1 contains buffer address
/* r2 contains buffersize     */
/* r0 return a number          */
numberEntry:
    push {fp,lr}         @ save  registres */
    push {r4,r6,r7}          @ save others registers
    mov r4,r1              @ save buffer address -> r4
    bl affichageMess
    mov r0,#STDIN         @ Linux input console
    //ldr r1,iAdrsBuffer   @ buffer address
    //mov r2,#BUFFERSIZE   @ buffer size
    mov r7, #READ         @ request to read datas
    swi 0                  @ call system
    mov r1,r4              @ buffer address
    mov r2,#0                @ end of string
    strb r2,[r1,r0]         @ store byte at the end of input string (r0
    @
    mov r0,r4              @ buffer address
    bl conversionAtoD    @ conversion string in number in r0

100:
    pop {r4,r6,r7}     		/* restaur others registers */
    pop {fp,lr}    				/* restaur des  2 registres */
    bx lr	        			/* return  */
/******************************************************************/
/*     display text with size calculation                         */
/******************************************************************/
/* r0 contains the address of the message */
affichageMess:
    push {fp,lr}    			/* save  registres */
    push {r0,r1,r2,r7}    		/* save others registers */
    mov r2,#0   				/* counter length */
1:      	/* loop length calculation */
    ldrb r1,[r0,r2]  			/* read octet start position + index */
    cmp r1,#0       			/* if 0 its over */
    addne r2,r2,#1   			/* else add 1 in the length */
    bne 1b          			/* and loop */
                                /* so here r2 contains the length of the message */
    mov r1,r0        			/* address message in r1 */
    mov r0,#STDOUT      		/* code to write to the standard output Linux */
    mov r7, #WRITE             /* code call system "write" */
    swi #0                      /* call systeme */
    pop {r0,r1,r2,r7}     		/* restaur others registers */
    pop {fp,lr}    				/* restaur des  2 registres */
    bx lr	        			/* return  */

 /******************************************************************/
/*     Convert a string to a number stored in a registry          */
/******************************************************************/
/* r0 contains the address of the area terminated by 0 or 0A */
/* r0 returns a number                           */
conversionAtoD:
    push {fp,lr}         @ save 2 registers
    push {r1-r7}         @ save others registers
    mov r1,#0
    mov r2,#10           @ factor
    mov r3,#0            @ counter
    mov r4,r0            @ save address string -> r4
    mov r6,#0            @ positive sign by default
    mov r0,#0            @ initialization to 0
1:     /* early space elimination loop */
    ldrb r5,[r4,r3]     @ loading in r5 of the byte located at the beginning + the position
    cmp r5,#0            @ end of string -> end routine
    beq 100f
    cmp r5,#0x0A        @ end of string -> end routine
    beq 100f
    cmp r5,#' '          @ space ?
    addeq r3,r3,#1      @ yes we loop by moving one byte
    beq 1b
    cmp r5,#'-'          @ first character is -
    moveq r6,#1         @  1 -> r6
    beq 3f              @ then move on to the next position
2:   /* beginning of digit processing loop */
    cmp r5,#'0'          @ character is not a number
    blt 3f
    cmp r5,#'9'          @ character is not a number
    bgt 3f
    /* character is a number */
    sub r5,#48
    ldr r1,iMaxi       @ check the overflow of the register
    cmp r0,r1
    bgt 99f            @ overflow error
    mul r0,r2,r0         @ multiply par factor 10
    add r0,r5            @ add to  r0
3:
    add r3,r3,#1         @ advance to the next position
    ldrb r5,[r4,r3]     @ load byte
    cmp r5,#0            @ end of string -> end routine
    beq 4f
    cmp r5,#0x0A            @ end of string -> end routine
    beq 4f
    b 2b                 @ loop
4:
    cmp r6,#1            @ test r6 for sign
    moveq r1,#-1
    muleq r0,r1,r0       @ if negatif, multiply par -1
    b 100f
99:  /* overflow error */
    ldr r0,=szMessErrDep
    bl   affichageMess
    mov r0,#0      @ return  zero  if error
100:
    pop {r1-r7}          @ restaur other registers
    pop {fp,lr}          @ restaur   2 registers
    bx lr                 @return procedure
/* constante program */
iMaxi: .int 1073741824
szMessErrDep:  .asciz  "Too large: overflow 32 bits.\n"


a: to :integer input "enter a value for a: "
b: to :integer input "enter a value for b: "

if a<b [ print [ a "is less than" b ] ]
if a>b [ print [ a "is greater than" b ] ]
if a=b [ print [ a "is equal to" b ] ]


let a = input('Enter value of a: ')
let b = input('Enter value of b: ')

if a < b:
    print 'a is less than b'
elif a > b:
    print 'a is greater than b'
elif a == b:
    print 'a is equal to b'


Gui, Add, Edit
Gui, Add, UpDown, vVar1
Gui, Add, Edit
Gui, Add, UpDown, vVar2
Gui, Add, Button, Default, Submit
Gui, Show
Return

ButtonSubmit:
  Gui, Submit, NoHide
  If (Var1 = Var2)
    MsgBox, % Var1 "=" Var2
  Else If (Var1 < Var2)
    MsgBox, % Var1 "<" Var2
  Else If (Var1 > Var2)
    MsgBox, % Var1 ">" Var2
Return

GuiClose:
  ExitApp


// This code doesn't try to protect against any malformed input.
a ::= next line from standard input→integer;
b ::= next line from standard input→integer;
If a > b then [Print: "a > b";]
else if a < b then [Print: "a < b";]
else if a = b then [Print: "a = b";];


Lbl FUNC
If r₁<r₂
 Disp "LESS THAN",i
End
If r₁=r₂
 Disp "EQUAL TO",i
End
If r₁>r₂
 Disp "GREATER THAN",i
End
Return


INPUT "Enter first number " ,a
INPUT "Enter second number " ,b
IF a < b THEN PRINT  a ," is less than ", b
IF a = b THEN PRINT  a, " is equal to ", b
IF a > b THEN PRINT  a, " is greater than ", b


@echo off
setlocal EnableDelayedExpansion
set /p a="A: "
set /p b="B: "
if %a% LSS %b% (
  echo %a% is less than %b%
) else ( if %a% GTR %b% (
  echo %a% is greater than %b%
) else ( if %a% EQU %b% (
  echo %a% is equal to %b%
)))


      INPUT "Enter two numbers separated by a comma: " a, b
      CASE TRUE OF
        WHEN a < b: PRINT ;a " is less than "; b
        WHEN a = b: PRINT ;a " is equal to "; b
        WHEN a > b: PRINT ;a " is greater than "; b
      ENDCASE


a = read()
b = read()
if (a < b) print "a is smaller than b\n"
if (a > b) print "a is greater than b\n"
if (a == b) print "a is equal to b\n"
quit


  Comp ← ⊑·/⟜"Greater than"‿"Equal To"‿"Lesser Than"(>∾=∾<)
⊑(/⟜⟨ "Greater than" "Equal To" "Lesser Than" ⟩>∾=∾<)

  4 Comp 5
"Lesser Than"
  5 Comp 5
"Equal To"
  6 Comp 5
"Greater than"


  get$:?A
& get$:?B
& (!A:!B&out$"A equals B"|)
& (!A:<!B&out$"A is less than B"|)
& (!A:>!B&out$"A is greater than B"|);


first = ask("First integer: ").to_i
second = ask("Second integer: ").to_i

when { first > second } { p "#{first} is greater than #{second}" }
     { first < second } { p "#{first} is less than #{second}" }
     { first == second } { p "#{first} is equal to #{second}" }


blsq ) "5 6"ps^pcm+.{"The first one is less than the second one""They are both equal""The second one is less than the first one"}\/!!sh
The first one is less than the second one
blsq ) "6 6"ps^pcm+.{"The first one is less than the second one""They are both equal""The second one is less than the first one"}\/!!sh
They are both equal
blsq ) "6 5"ps^pcm+.{"The first one is less than the second one""They are both equal""The second one is less than the first one"}\/!!sh
The second one is less than the first one


#include <stdio.h>

int main()
{
  int a, b;
  scanf("%d %d", &a, &b);

  if (a < b)
    printf("%d is less than %d\n", a, b);

  if (a == b)
    printf("%d is equal to %d\n", a, b);

  if (a > b)
    printf("%d is greater than %d\n", a, b);

  return 0;
}


using System;

class Program
{
    static void Main()
    {
        int a = int.Parse(Console.ReadLine());
        int b = int.Parse(Console.ReadLine());
        if (a < b)
            Console.WriteLine("{0} is less than {1}", a, b);
        if (a == b)
            Console.WriteLine("{0} equals {1}", a, b);
        if (a > b)
            Console.WriteLine("{0} is greater than {1}", a, b);
    }
}


#include <iostream>

int main()
{
  int a, b;

  if (!(std::cin >> a >> b)) {
    std::cerr << "could not read the numbers\n";
    return 1;
  }

  // test for less-than
  if (a < b)
    std::cout << a << " is less than " << b << "\n";

  // test for equality
  if (a == b)
    std::cout << a << " is equal to " << b << "\n";

  // test for greater-than
  if (a > b)
    std::cout << a << " is greater than " << b << "\n";
}


bundle agent __main__
{
  vars:
      # Change the values to test:
      "first_integer" int => "10";
      "second_integer" int => "9";

  reports:
     "The first integer ($(first_integer)) is less than the second integer ($(second_integer))."
        if => islessthan( "$(first_integer)", "$(second_integer)" );
     "The first integer ($(first_integer)) is equal to the second integer ($(second_integer))."
        if => eval( "$(first_integer)==$(second_integer)", "class", "infix" );
     "The first integer ($(first_integer)) is greater than the second integer ($(second_integer))."
        if => isgreaterthan( "$(first_integer)", "$(second_integer)" );
}


fun void intComparison (int one, int two)
{
    if(one < two) <<< one, " is less than ", two >>>;
    if(one == two) <<< one, " is equal than ", two >>>;
    if(one > two) <<< one, " is greater than ", two >>>;
}
//  uncomment next line and change values to test
// intComparison (2,4);


import StdEnv

compare a b
    | a < b = "A is less than B"
    | a > b = "A is more than B"
    | a == b = "A equals B"

Start world
    # (console, world) = stdio world
      (_, a, console) = freadi console
      (_, b, console) = freadi console
    = compare a b


   Function Compare(a, b)
   IF a < b
      ? "A is less than B"
   ELSEIF a > b
      ? "A is more than B"
   ELSE
      ? "A equals B"
   ENDIF
   Return Nil


(let [[a b] (repeatedly read)]
  (doseq [[op string] [[< "less than"]
                       [> "greater than"]
                       [= "equal to"]]]
    (when (op a b)
      (println (str a " is " string " " b)))))


# Define A and B as integers. For example:
#   cmake -DA=3 -DB=5 -P compare.cmake

# The comparisons can take variable names, or they can take numbers.
# So these act all the same:
#   A LESS B
#   ${A} LESS ${B}
#   A LESS ${B}
#   ${A} LESS B

if(A LESS B)
  message(STATUS "${A} is less than ${B}")
endif()
if(A EQUAL B)
  message(STATUS "${A} is equal to ${B}")
endif()
if(A GREATER B)
  message(STATUS "${A} is greater than ${B}")
endif()


       IDENTIFICATION DIVISION.
       PROGRAM-ID. Int-Compare.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  A PIC 9(10).
       01  B PIC 9(10).

       PROCEDURE DIVISION.
           DISPLAY "First number: " WITH NO ADVANCING
           ACCEPT A
           DISPLAY "Second number: " WITH NO ADVANCING
           ACCEPT B

*          *> Note: Longer verbal forms may be used instead of symbols
*          *> e.g. 'IS GREATER THAN' instead '<'
           IF A < B
               DISPLAY A " is less than " B
           ELSE IF A = B
               DISPLAY A " is equal to " B
           ELSE IF A > B
               DISPLAY A " is larger than " B
           END-IF.

           GOBACK
           .


<cffunction name="CompareInteger">
    <cfargument name="Integer1" type="numeric">
    <cfargument name="Integer2" type="numeric">
    <cfset VARIABLES.Result = "" >
    <cfif ARGUMENTS.Integer1 LT ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is less than " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfif ARGUMENTS.Integer1 LTE ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is less than or equal to " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfif ARGUMENTS.Integer1 GT ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is greater than " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfif ARGUMENTS.Integer1 GTE ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is greater than or equal to " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfif ARGUMENTS.Integer1 EQ ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is equal to " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfif ARGUMENTS.Integer1 NEQ ARGUMENTS.Integer2 >
	    <cfset VARIABLES.Result = VARIABLES.Result & "(" & ARGUMENTS.Integer1 & " is not equal to " & ARGUMENTS.Integer2 & ")" >
    </cfif>
    <cfreturn VARIABLES.Result >
</cffunction>


(let ((a (read *standard-input*))
      (b (read *standard-input*)))
    (cond
      ((not (numberp a)) (format t "~A is not a number." a))
      ((not (numberp b)) (format t "~A is not a number." b))
      ((< a b) (format t "~A is less than ~A." a b))
      ((> a b) (format t "~A is greater than ~A." a b))
      ((= a b) (format t "~A is equal to ~A." a b))
      (t (format t "Cannot determine relevance between ~A and ~B!" a b)))))


start:  STP        ; get input

x:      NOP
y:      NOP

        LDA  x
        SUB  y
        BRZ  start ; x=y, A=0

loop:   LDA  x
        SUB  one
        BRZ  x<y
        STA  x

        LDA  y
        SUB  one
        BRZ  x>y
        STA  y

        JMP  loop

x>y:    LDA  one   ; A := 1
        JMP  start

x<y:    SUB  one   ; A := 0-1
        JMP  start

one:         1


void main() {
    import std.stdio, std.conv, std.string;

    int a = 10, b = 20;
    try {
        a = readln.strip.to!int;
        b = readln.strip.to!int;
    } catch (StdioException) {}

    if (a < b)
        writeln(a, " is less than ", b);

    if (a == b)
        writeln(a, " is equal to ", b);

    if (a > b)
        writeln(a, " is greater than ", b);
}


[Use _ (underscore) as negative sign for numbers.]P []pP
[Enter two numbers to compare: ]P
? sbsa
[[greater than]]sp lb la >p
[   [less than]]sp lb la <p
[    [equal to]]sp lb la =p
la n [ is ]P P [ ]P lbn []pP


$ inquire a "Please provide an integer"
$ inquire b "Please provide another"
$ if a .lt. b then $ write sys$output "the first integer is less"
$ if a .eq. b then $ write sys$output "the integers have the same value"
$ if a .gt. b then $ write sys$output "the first integer is greater"


program IntegerCompare;

{$APPTYPE CONSOLE}

var
  a, b: Integer;
begin
  Readln(a, b);
  if a < b then Writeln(a, ' is less than ', b);
  if a = b then Writeln(a, ' is equal to ', b);
  if a > b then Writeln(a, ' is greater than ', b);
end.


proc nonrec main() void:
    int a, b;
    write("Please enter two integers: ");
    read(a, b);
    if   a<b then writeln(a, " < ", b)
    elif a=b then writeln(a, " = ", b)
    elif a>b then writeln(a, " > ", b)
    fi
corp


func compare(a, b) {
   if a < b {
      "A is less than B"
   } else if a > b {
      "A is more than B"
   } else {
      "A equals B"
   }
}


def compare(a :int, b :int) {
  println(if (a < b)        { `$a < $b` } \
          else if (a <=> b) { `$a = $b` } \
          else if (a > b)   { `$a > $b` } \
          else              { `You're calling that an integer?` })
}


a = number input
b = number input
if a < b
  print "less"
.
if a = b
  print "equal"
.
if a > b
  print "greater"
.


CompareThem(INTEGER A,INTEGER B) := FUNCTION
  Result            := A <=> B;
  STRING ResultText := CASE (Result,1 => 'is greater than', 0 => 'is equal to','is less than');
  RETURN A + ' ' + TRIM(ResultText) + ' ' + B;
END;

CompareThem(1,2); //Shows "1 is less than 2"
CompareThem(2,2); //Shows "2 is equal to 2"
CompareThem(2,1); //Shows "2 is greater than 1"


[ Integer comparison
  ==================

  A program for the EDSAC

  Illustrates the use of the E
  (branch on accumulator sign
  bit clear) and G (branch on
  accumulator sign bit set)
  orders

  The integers to be tested, x
  and y, should be stored in
  addresses [email protected] and [email protected]

  Output: the program causes the
  machine to print
    '+' if x > y,
    '=' if x = y,
    '-' if x < y.

  Works with Initial Orders 2   ]

        T56K  [ load point      ]
        GK    [ base address    ]

        [email protected]  [ figure shift    ]

        [email protected]  [ a = x           ]
        [email protected]  [ a -= y          ]
        [email protected]  [ if a<0 go to 10 ]

        [email protected]  [ a -= 1          ]
        [email protected]   [ if a>=0 go to 8 ]

        [email protected]  [ write '='       ]
        ZF    [ halt            ]

[  8 ]  [email protected]  [ write '+'       ]
        ZF    [ halt            ]

[ 10 ]  [email protected]  [ write '-'       ]
        ZF    [ halt            ]

[ 12 ]  P0D   [ const: 1        ]

[ 13 ]  P16D  [ x = 37          ]
[ 14 ]  P14F  [ y = 28          ]

[ 15 ]  #F    [ figure shift    ]
[ 16 ]  ZF    [ + character     ]
[ 17 ]  VF    [ = character     ]
[ 18 ]  AF    [ - character     ]

        EZPF  [ begin execution ]


compare = fn (A, B) {
    if A == B {
        io.format("~p equals ~p~n", [A, B])
    }
    else {
        ok
    }

    if A < B {
        io.format("~p is less than ~p~n", [A, B])
    }
    else {
        ok
    }

    if A > B {
        io.format("~p is greater than ~p~n", [A, B])
    }
    else {
        ok
    }
}

@public
run = fn () {
    compare(5, 5)
    compare(6, 5)
    compare(4, 5)
}


class
	APPLICATION
inherit
	ARGUMENTS
create
	make

feature {NONE} -- Initialization

	make
		local
			i, j: INTEGER_32
		do
			io.read_integer_32
			i := io.last_integer_32

			io.read_integer_32
			j := io.last_integer_32

			if i < j then
				print("first is less than second%N")
			end
			if i = j then
				print("first is equal to the second%N")
			end
			if i > j then
				print("first is greater than second%N")
			end
		end
end


import extensions;

public program()
{
   var a := console.readLine().toInt();
   var b := console.readLine().toInt();

   if (a < b)
       { console.printLine(a," is less than ",b) };

   if (a == b)
       { console.printLine(a," equals ",b) };

   if (a > b)
       { console.printLine(a," is greater than ",b) }
}


{a,_} = IO.gets("Enter your first integer: ") |> Integer.parse
{b,_} = IO.gets("Enter your second integer: ") |> Integer.parse

cond do
  a < b ->
    IO.puts "#{a} is less than #{b}"
  a > b ->
    IO.puts "#{a} is greater than #{b}"
  a == b ->
    IO.puts "#{a} is equal to #{b}"
end


(defun integer-comparison (a b)
  "Compare A to B and print the outcome in the message buffer."
  (interactive "nFirst integer ⇒\nnSecond integer ⇒")
  (cond
    ((< a b) (message "%d is less than %d." a b))
    ((> a b) (message "%d is greater than %d." a b))
    ((= a b) (message "%d is equal to %d." a b))))


main() ->
    {ok, [N]} = io:fread("First integer: ", "~d"),
    {ok, [M]} = io:fread("First integer: ", "~d"),
    if
        N < M ->
            io:format("~b is less than ~b~n",[N,M]);
        N > M ->
            io:format("~b is greater than ~b~n",[N,M]);
        N == M ->
            io:format("~b is equal to ~b~n",[N,M])
    end.
    if
       N =< M ->
           io:format("~b is less than or equal to ~b~n",[N,M]);
       N >= M ->
           io:format("~b is greater than or equal to ~b~n",[N,M])
    end.


include get.e

integer a,b
a = floor(prompt_number("a = ",{}))
b = floor(prompt_number("b = ",{}))

puts(1,"a is ")
if a < b then
    puts(1,"less then")
elsif a = b then
    puts(1,"equal to")
elsif a > b then
    puts(1,"grater then")
end if
puts(1," b")


=IF($A1>$B1;concatenate($A1;" is greater than ";$B1);IF($A1<$B1;concatenate($A1;" is smaller than ";$B1);concatenate($A1;" is equal to ";$B1)))


let compare_ints a b =
    let r =
        match a with
        | x when x < b -> -1, printfn "%d is less than %d" x b
        | x when x = b -> 0,  printfn "%d is equal to %d" x b
        | x when x > b -> 1,  printfn "%d is greater than %d" x b
        | x -> 0, printf "default condition (not reached)"
    fst r


: example ( -- )
readln readln [ string>number ] [email protected]
[ > [ "A > B" print ] when ]
[ < [ "A < B" print ] when ]
[ = [ "A = B" print ] when ] 2tri ;


^^ \[email protected][email protected][email protected][email protected]\
>[\$," is greater than "\$,]?
\>[\$," is less than "\$,]?
=["characters are equal"]?


class Main
{
  public static Void main ()
  {
    try
    {
      Env.cur.out.print ("Enter number 1: ").flush
      num1 := Env.cur.in.readLine.toInt
      Env.cur.out.print ("Enter number 2: ").flush
      num2 := Env.cur.in.readLine.toInt

      if (num1 < num2)
        echo ("$num1 is smaller than $num2")
      else if (num1 == num2)
        echo ("$num1 is equal to $num2")
      else if (num1 > num2)
        echo ("$num1 is greater than $num2")
    }
    catch (Err e)
      echo ("You must enter two integers")
  }
}


Func Compare =
    ?a;
    ?b;
    if a=b then !'Equal' fi;
    if a<b then !'Less than' fi;
    if a>b then !'Greater than' fi;
    .;


l2=?vv ~<                                                        v o<
v   <>l?^"Please pre-populate the stack with the two integers."ar>l?^;
\$:@@:@)?v   v               ;oanv!!!?<
         >$n" is greater than "{r>ol1=^
/            <
\$:@@:@=?v   v           ;oanv!!!?<
         >$n" is equal to "{r>ol1=^
/            <
\$:@@:@(?v   v               ;oanv!!!?<
         >$n" is smaller than "{r>ol1=^
             >        v
/oo". "nooooo" and "n$<                                                            v o<
>"They're not equal, not greater than and not smaller than eachother... strange."ar>l?^;


: compare-integers ( a b -- )
   2dup < if ." a is less than b" then
   2dup > if ." a is greater than b" then
        = if ." a is equal to b" then ;


program arithif
integer a, b

c        fortran 77 I/O statements, for simplicity
read(*,*) a, b

if ( a - b ) 10, 20, 30
10 write(*,*) a, ' is less than ', b
   goto 40

20 write(*,*) a, ' is equal to ', b
   goto 40

30 write(*,*) a, ' is greater than ', b
40 continue

end


' FB 1.05.0 Win64

Dim As Integer x, y
Input "Please enter two integers, separated by a comma : ", x , y

If x < y Then
  Print x; " is less than "; y
End If

If x = y Then
  Print x; " is equal to "; y
End If

If x > y Then
  Print x; " is greater than "; y
End If

Print
Print "Press any key to exit"
Sleep


read a
read b

if test $a -gt $b
    echo Greater
else if test $a -lt $b
    echo Less
else if test $a -eq $b
    echo Equal
end


[a,b] = eval[input["Enter numbers",["a","b"]]]
if a<b
   println["$a < $b"]
if a==b
   println["$a == $b"]
if a>b
   println["$a > $b"]


import console.readInt

a = readInt()
b = readInt()

val (_, c) = [((<), 'less than'), ((==), 'equal to'), ((>), 'greater than')].find( (compare, _) -> compare(a, b) ).get()

println( "$a is $c $b." )


_window = 1
begin enum 1
  _integer1Fld
  _integer2Fld
  _compareBtn
  _messageLabel
end enum

local fn BuildWindow
  window _window, @"Integer Comparison", (0,0,356,85)

  textfield _integer1Fld,,, (20,44,112,21)
  TextFieldSetPlaceholderString( _integer1Fld, @"Integer 1" )

  textfield _integer2Fld,,, (140,44,112,21)
  TextFieldSetPlaceholderString( _integer2Fld, @"Integer 2" )

  button _compareBtn,,, @"Compare", (253,38,90,32)

  textlabel _messageLabel,, (18,20,320,16)
  ControlSetAlignment( _messageLabel, NSTextAlignmentCenter )
end fn

local fn DoDialog( ev as long, tag as long )
  long int1, int2

  select ( ev )
    case _btnClick
      select ( tag )
        case _compareBtn
          int1 = fn ControlIntegerValue( _integer1Fld )
          int2 = fn ControlIntegerValue( _integer2Fld )

          if ( int1 < int2 ) then textlabel _messageLabel, @"The first integer is less than the second integer."
          if ( int1 == int2 ) then textlabel _messageLabel, @"The first integer is equal to the second integer."
          if ( int1 > int2 ) then textlabel _messageLabel, @"The first integer is greater than the second integer."

      end select

    case _controlTextDidChange
      textlabel _messageLabel, @""
  end select
end fn

fn BuildWindow

on dialog fn DoDialog

HandleEvents


Public Sub Form_Open()
Dim sIn As String = InputBox("Enter 2 integers seperated by a comma")
Dim iFirst, iSecond As Integer

iFirst = Val(Split(sIn)[0])
iSecond = Val(Split(sIn)[1])

If iFirst < iSecond Then Print iFirst & " is smaller than " & iSecond & gb.NewLine
If iFirst > iSecond Then Print iFirst & " is greater than " & iSecond & gb.NewLine
If iFirst = iSecond Then Print iFirst & " is equal to " & iSecond

End


package main

import (
	"fmt"
	"log"
)

func main() {
	var n1, n2 int
	fmt.Print("enter number: ")
	if _, err := fmt.Scan(&n1); err != nil {
		log.Fatal(err)
	}
	fmt.Print("enter number: ")
	if _, err := fmt.Scan(&n2); err != nil {
		log.Fatal(err)
	}
	switch {
	case n1 < n2:
		fmt.Println(n1, "less than", n2)
	case n1 == n2:
		fmt.Println(n1, "equal to", n2)
	case n1 > n2:
		fmt.Println(n1, "greater than", n2)
	}
}


PROCEDURE Compare( a, b )

   IF a < b
      ? "A is less than B"
   ELSEIF a > b
      ? "A is more than B"
   ELSE
      ? "A equals B"
   ENDIF

   RETURN


myCompare :: Integer -> Integer -> String
myCompare a b
  | a < b  = "A is less than B"
  | a > b  = "A is greater than B"
  | a == b = "A equals B"

main = do
  a <- readLn
  b <- readLn
  putStrLn $ myCompare a b


let a scan int
let b scan int

if a < b
  println a + " is less than " + b
endif

if a > b
  println a + " is greater than " + b
endif

if a = b
  println a + " is equal to " + b
endif


DLG(NameEdit=a, NameEdit=b, Button='OK')

IF (a < b) THEN
    WRITE(Messagebox) a, ' is less than ', b
  ELSEIF(a == b) THEN
    WRITE(Messagebox) a, ' is equal to ', b
  ELSEIF(a > b) THEN
    WRITE(Messagebox) a, ' is greater than ', b
ENDIF


I64 *a, *b;
a = Str2I64(GetStr("Enter your first number: "));
b = Str2I64(GetStr("Enter your second number: "));

if (a < b)
  Print("%d is less than %d\n", a, b);

if (a == b)
  Print("%d is equal to %d\n", a, b);

if (a > b)
  Print("%d is greater than %d\n", a, b);


(def a (int (input "Enter value of a: ")))
(def b (int (input "Enter value of b: ")))

(print (cond [(< a b) "a is less than b"]
             [(> a b) "a is greater than b"]
             [(= a b) "a is equal to b"]))


software {
	a = number(read(' '))
	b = number(read())

	if a < b
		print(a, " is less than ", b)
	end

	if a = b
		print(a, " is equal to ", b)
	end

	if a > b
		print(a, " is greater than ", b)
	end
}


procedure main()

until integer(a) do {
   writes("Enter the first integer a := ")
   write(a := read())
   }

until integer(b) do {
   writes("Enter the second integer b := ")
   write(b := read())
   }
writes("Then ")
write(a," < ", a < b)
write(a," = ", a = b)
write(a," > ", a > b)
end


compare=: < , = , >

cti=: dyad define
  select  =. ;@#
  English =. ' is less than ';' is equal to ';' is greater than '
  x (":@[, (compare select English"_), ":@]) y
)


import java.io.*;

public class compInt {
   public static void main(String[] args) {
       try {
           BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

           int nbr1 = Integer.parseInt(in.readLine());
           int nbr2 = Integer.parseInt(in.readLine());

           if(nbr1<nbr2)
               System.out.println(nbr1 + " is less than " + nbr2);

           if(nbr1>nbr2)
                System.out.println(nbr1 + " is greater than " + nbr2);

           if(nbr1==nbr2)
                System.out.println(nbr1 + " is equal to " + nbr2);
       } catch(IOException e) { }
   }
}


// Using type coercion
function compare(a, b) {
  if (a==b) print(a + " equals " + b);
  if (a < b) print(a + " is less than " + b);
  if (a > b) print(a + " is greater than " + b);
}

// Without using type coercion and using standards
// Written for browsers
// assumption of a and b are both integers if typeof test passes
function compare (a, b) {
  if (typeof a === typeof b) {
    if (a === b) {
      document.writeln(a + " equals " + b);
    }
    if (a < b) {
      document.writeln(a + " is less than " + b);
    }
    if (a > b) {
      document.writeln(a + " is greater than " + b);
    }
  } else {
    // "1" and 1 are an example of this as the first is type string and the second is type number
    print(a + "{" + (typeof a) + "} and " + b + "{" + (typeof b) + "} are not of the same type and cannot be compared.");
  }
}


#!/usr/local/bin/joy.exe
DEFINE
prompt  == "Please enter a number and <Enter>: " putchars;
newline == '\n putch;
putln   == put newline.

stdin		# F
prompt fgets	# S F
10 strtol	# A F
swap		# F A
dupd		# F A A
prompt fgets	# S F A A
10 strtol	# B F A A
popd		# B A A
dup		# B B A A
rollup		# B A B A
[<] [swap put "is less than "    putchars putln] [] ifte
[=] [swap put "is equal to "     putchars putln] [] ifte
[>] [swap put "is greater than " putchars putln] [] ifte
		# B A
quit.


# compare/0 compares the first two items if they are numbers,
# otherwise an "uncomparable" message is emitted.

def compare:
  def english:
    if .[0] < .[1] then "less than"
    elif .[0] == .[1] then "equal to"
    else "greater than"
    end;
  if (.[0]|type) == "number" and (.[1]|type) == "number" then
        "\(.[0]) is \(english) \(.[1])"
  else
       "\(.[0]) is uncomparable to \(.[1])"
  end ;

compare


function compare()
    int1 = readline(stdin)
    int2 = readline(stdin)
    print(int1, " is ",
       int1 <  int2 ? "less than "    :
       int1 == int2 ? "equal to "     :
       int1 >  int2 ? "greater than " :
       "uncomparable to",
      int2)
end


fun main(args: Array<String>) {
    val n1 = readLine()!!.toLong()
    val n2 = readLine()!!.toLong()
    println(when {
        n1 < n2 -> "$n1 is less than $n2"
        n1 > n2 -> "$n1 is greater than $n2"
        n1 == n2 -> "$n1 is equal to $n2"
        else -> ""
    })
}


{def compare
 {lambda {:a :b}
  {if {< :a :b}
   then :a is lesser than :b
   else {if {> :a :b}
   then :a is greater than :b
   else :a is equal to :b}}}}

{compare 1 2}
-> 1 is lesser than 2

{compare 2 1}
-> 2 is greater than 1

{compare 1 1}
-> 1 is equal to 1


local(
	number1	= integer(web_request -> param('number1')),
	number2	= integer(web_request -> param('number2'))
)

#number1 < #number2 ? 'Number 1 is less than Number 2' | 'Number 1 is not less than Number 2'
'
'
#number1 == #number2 ? 'Number 1 is the same as Number 2' | 'Number 1 is not the same as Number 2'
'
'
#number1 > #number2 ? 'Number 1 is greater than Number 2' | 'Number 1 is not greater than Number 2'


input "Enter an integer for a.  ";a
input "Enter an integer for b.  ";b

'a=int(a):b=int(b) ???
print "Conditional evaluation."
if a<b then print "a<b " ; a ; " < " ; b
if a=b then print "a=b " ; a ; " = " ; b
if a>b then print "a>b " ; a ; " > " ; b

print "Select case evaluation."
select case
    case (a<b)
        print "a<b " ; a ; " < " ; b
    case (a=b)
        print "a=b " ; a ; " = " ; b
    case (a>b)
        print "a>b " ; a ; " > " ; b
end select


print "Enter two numbers separated by space"
set rc [readline]
set a [index $rc 0]
set b [index $rc 1]

if {$a < $b} {print "$a is less than $b"}
if {$a == $b} {print "$a is equal to $b"}
if {$a > $b} {print "$a is greater than $b"}


on compare (a, b)
  if a < b then put a&" is less than "&b
  if a = b then put a&" is equal to "&b
  if a > b then put a&" is greater than "&b
end


ask question "Enter 2 numbers (comma separated)" with empty titled "Enter 2 numbers"
if it is not empty then
    put item 1 of it into num1
    put item 2 of it into num2
    if isnumber(num1) and isnumber(num2) then
        if num1 < num2 then answer num1 && "is less than" && num2
        if num1 is num2 then answer num1 && "is equal to" && num2
        if num1 > num2 then answer num1 && "is greater than" && num2

        -- alternative is to use switch case construct
        switch
            case (num1 < num2)
                answer num1 && "is less! than" && num2; break
            case (num1 > num2)
                answer num1 && "is greater! than" && num2; break
            case (num1 = num2)
                answer num1 && "equal! to" && num2
        end switch
    end if
end if


; ModuleID = 'test.o'
;e means little endian
;p: { pointer size : pointer abi : preferred alignment for pointers }
;i same for integers
;v is for vectors
;f for floats
;a for aggregate types
;s for stack objects
;n: {size:size:size...}, best integer sizes
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
;this was compiled with mingw32; thus it must be linked to a compatible c library
target triple = "i386-mingw32"

; Declare string constants
@.str = private constant [6 x i8] c"%d %d\00", align 1 ; <[6 x i8]*> [#uses=1]
@.str1 = private constant [20 x i8] c"%d is less than %d\0A\00", align 1 ; <[20 x i8]*> [#uses=1]
@.str2 = private constant [19 x i8] c"%d is equal to %d\0A\00", align 1 ; <[19 x i8]*> [#uses=1]
@.str3 = private constant [23 x i8] c"%d is greater than %d\0A\00", align 1 ; <[23 x i8]*> [#uses=1]

;Declare main function (entry point). It does not throw any exceptions, and returns an integer of size 32.
define i32 @main() nounwind {
;Entry block
entry:
  ;Allocate the first integer, register %a will point to that
  %a = alloca i32, align 4                        ; <i32*> [#uses=4]
  ;Allocate the second integer, register %b will point to that
  %b = alloca i32, align 4                        ; <i32*> [#uses=4]
  ;Use the C standard library function scanf() to obtain input from users.
  ;Scanf takes a pointer to the string constant @.str, "%d %d\00", which will take two integers from the user.
  ;getelementptr basically does pointer math, in this case, no ptr math is required (we point to the beginning of @.str).
  ;Pass %a and %b, which are pointers to integers allocated previously.
  ;Scanf will store the two integers into the memory locations represented by %a and %b
  %0 = call i32 (i8*, ...)* @scanf(i8* noalias getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i32* %a, i32* %b) nounwind ; <i32> [#uses=0]
  ;Load the integer pointed to by %a and %b into registers %1 and %2 respectively
  %1 = load i32* %a, align 4                      ; <i32> [#uses=3]
  %2 = load i32* %b, align 4                      ; <i32> [#uses=3]
  ;Boolean register which represents if %1 is less than to %2
  %3 = icmp slt i32 %1, %2                        ; <i1> [#uses=1]
  ;If %1 is less than to %2, goto branch %bb, otherwise, goto %bb1
  br i1 %3, label %bb, label %bb1

;If integer %1 is less than %2
bb:                                               ; preds = %entry
  ;Use the C standard library function printf to output information to users
  ;Print @.str1, "%d is less than %d\0A\00"
  ;Additionally, pass the integers %1 and %2 to printf, to be formatted into the string
  %4 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([20 x i8]* @.str1, i32 0, i32 0), i32 %1, i32 %2) nounwind ; <i32> [#uses=0]
  ;Continue on to %bb1, to check for equality of the two integers
  br label %bb1

;Continue checking if the integers are equal
bb1:                                              ; preds = %bb, %entry
  ;Boolean register which represents if %1 is equal to %2
  %5 = icmp eq i32 %1, %2                         ; <i1> [#uses=1]
  ;If %1 is equal to %2, goto branch %bb2, otherwise, goto %bb3
  br i1 %5, label %bb2, label %bb3

;If integer %1 is equal to %2
bb2:                                              ; preds = %bb1
  ;Use the C standard library function printf to output information to users
  ;Print @.str2 "%d is equal to %d\0A\00"
  ;Additionally, pass the integers %1 and %2 to printf, to be formatted into the string
  %6 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([19 x i8]* @.str2, i32 0, i32 0), i32 %1, i32 %2) nounwind ; <i32> [#uses=0]
  ;Continue on to %bb3, to check if %1 is greater than %2
  br label %bb3

;Continue checking if %1 is greater than %2
bb3:                                              ; preds = %bb2, %bb1
  ;Boolean register which represents if %1 is greater than %2
  %7 = icmp sgt i32 %1, %2                      ; <i1> [#uses=1]
  ;If %1 is greather than %2, goto branch %bb4, otherwise, goto %bb5
  br i1 %7, label %bb4, label %bb5

;If integer %1 is greater than %2
bb4:                                              ; preds = %bb3
  ;Use the C standard library function printf to output information to users
  ;Print @.str3 "%d is greater than %d\0A\00"
  ;Additionally, pass the integers %1 and %2 to printf, to be formatted into the string
  %8 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([23 x i8]* @.str3, i32 0, i32 0), i32 %1, i32 %2) nounwind ; <i32> [#uses=0]
  ;Return 0 for the main function, indicating program executed successfully
  ret i32 0

bb5:                                              ; preds = %bb3
  ;Return 0 for the main function, indicating program executed successfully
  ret i32 0
}

;Declare external fuctions
declare i32 @scanf(i8* nocapture, ...) nounwind

declare i32 @printf(i8* nocapture, ...) nounwind


to compare :a :b
  if :a = :b [(print :a [equals] :b)]
  if :a < :b [(print :a [is less than] :b)]
  if :a > :b [(print :a [is greater than] :b)]
end


(* Comparaison de deux entiers en LSE (LSE-2000) *)
ENTIER A, B
LIRE ['Entrez un premier entier:',U] A
LIRE ['Entrez un second  entier:',U] B
SI A < B ALORS
    AFFICHER [U,' est plus petit que ',U,/] A, B
FIN SI
SI A = B ALORS
    AFFICHER [U,' est égale à ',U,/] A, B
FIN SI
SI A > B ALORS
    AFFICHER [U,' est plus grand que ',U,/] A, B
FIN SI


over : 2 pick
2dup : over over

compare : 2dup = then " equals"
compare : 2dup < then " is less than"
compare : 2dup > then " is more than"

show : compare rot , sp ,t sp , nl


print('Enter the first number: ')
a = tonumber(io.stdin:read())
print('Enter the second number: ')
b = tonumber(io.stdin:read())

if a < b then print(a .. " is less than " .. b) end
if a > b then print(a .. " is greater than " .. b) end
if a == b then print(a .. " is equal to " .. b) end


CompareNumbers := proc( )
    local a, b;
    printf( "Enter a number:> " );
    a := parse(readline());
    printf( "Enter another number:> " );
    b := parse(readline());
    if a < b then
        printf("The first number is less than the second");
    elif a = b then
        printf("The first number is equal to the second");
    elif a > b then
        printf("The first number is greater than the second");
    end if;
end proc:

CompareNumbers();


a=Input["Give me the value for a please!"];
b=Input["Give me the value for b please!"];
If[a==b,Print["a equals b"]]
If[a>b,Print["a is bigger than b"]]
If[a<b,Print["b is bigger than a"]]


/* all 6 comparison operators (last is "not equal") */
block(
   [a: read("a?"), b: read("b?")],
   if a < b  then print(a, "<",  b),
   if a <= b then print(a, "<=", b),
   if a > b  then print(a, ">",  b),
   if a >= b then print(a, ">=", b),
   if a = b  then print(a, "=",  b),
   if a # b  then print(a, "#",  b))$


a = getKBValue prompt:"Enter value of a:"
b = getKBValue prompt:"Enter value of b:"
if a < b then print "a is less then b"
else if a > b then print "a is greater then b"
else if a == b then print "a is equal to b"


message "integer 1: ";
a1 := scantokens readstring;
message "integer 2: ";
a2 := scantokens readstring;
if a1 < a2:
  message decimal a1 & " is less than " & decimal a2
elseif a1 > a2:
  message decimal a1 & " is greater than " & decimal a2
elseif a1 = a2:
  message decimal a1 & " is equal to " & decimal a2
fi;
end


"$1 is $2 $3."
("Enter an integer" ask) 2 times over over
(
  ((>) ("greater than"))
  ((<) ("less than"))
  ((==) ("equal to"))
) case
' append prepend % print


integer1 = input("Please Input Integer 1:").val
integer2 = input("Please Input Integer 2:").val
if integer1 < integer2 then print integer1 + " is less than " + integer2
if integer1 == integer2 then print integer1 + " is equal to " + integer2
if integer1 > integer2 then print integer1 + " is greater than " + integer2


"" Integer comparison
"" assumes macros on input stream 1, terminal on stream 2
MCSKIP MT,<>
MCSKIP SL WITH ~
MCINS %.
MCDEF SL SPACES NL AS <MCSET T1=%A1.
MCSET T2=%A2.
MCGO L1 UNLESS T1 EN T2
%A1. is equal to %A2.
%L1.MCGO L2 UNLESS %A1. GR %A2.
%A1. is greater than %A2.
%L2.MCGO L3 IF %A1. GE %A2.
%A1. is less than %A2.
%L3.
MCSET S10=0
>
MCSET S1=1
~MCSET S10=2


// main registers
p	IS	$255	% pointer
pp	GREG		% backup for p
A	GREG		% first int
B	GREG		% second int

// arg registers
argc	IS	$0
argv	IS	$1

	LOC	Data_Segment
	GREG	@
ERR	BYTE	"Wrong number of arguments",#a,0
ILLH	BYTE	"Argument -> ",0
ILLT	BYTE	" <- contains an illegal character",#a,0
LT	BYTE	"A is less than B",#a,0
EQ	BYTE	"A equals B",#a,0
GT	BYTE	"A is greater than B",#a,0

	LOC	#1000
	GREG	@
// call: p points to the start of a 0-terminated numeric string
//       leading chars + and - are allowed
//       reg $72   0 if negative int
//	 reg $73   gen. purpose
// return: reg $70 contains integer value
readInt	XOR	$70,$70,$70	% reset result reg: N=0.
	LDA	pp,p		% remember &p
	LDBU	$72,p
	CMP	$73,$72,'+'	% ignore '+'
	BZ	$73,2F
	CMP	$72,$72,'-'
	BNZ	$72,1F
2H	INCL	p,1
	JMP	1F
				% repeat
3H	CMP	$73,$71,'0'	%  if c < '0' or c > '9'
	BN	$73,4F		%  then print err and halt program
	CMP	$73,$71,'9'
	BP	$73,4F
	SUB	$71,$71,'0'	%  'extract' number
	MUL	$70,$70,10
	ADD	$70,$70,$71	%  N = 10 * N + digit
	INCL	p,1
1H	LDBU	$71,p		%  get next digit
	PBNZ	$71,3B		% until end of string
	CMP	$72,$72,0
	BNZ	$72,2F		% if marked negative
	NEG	$70,$70		%  then make negative
2H	GO	$127,$127,0	% return (N)

4H	LDA	p,ILLH
	TRAP	0,Fputs,StdErr
	LDA	p,pp
	TRAP	0,Fputs,StdErr
	LDA	p,ILLT
	TRAP	0,Fputs,StdErr
	TRAP	0,Halt,0

// entrance of program
// e.g. ~> mmix compare2ints A B
//
Main	CMP	p,argc,3	% main (argc, argv) {
	BZ	p,1F		%  if argc == 3 then continue
	LDA	p,ERR		%  else print wrong number of args
	TRAP	0,Fputs,StdErr
	TRAP	0,Halt,0
// get ints A and B
1H	LDOU	p,argv,8	% fetch addres of first int
	GO	$127,readInt	% read int A
	ADD	A,$70,0

	LDOU	p,argv,16
	GO	$127,readInt	% read int B
	ADD	B,$70,0

// perform comparison
	CMP	A,A,B		% case compare A B
	LDA	p,LT
	BN	A,2F		% LT:   print 'LT'
	LDA	p,EQ
	BZ	A,2F		% EQ:   print 'EQ'
	LDA	p,GT		% _ :   print 'GT'
2H	TRAP	0,Fputs,StdOut	% print result
	TRAP	0,Halt,0


MODULE IntCompare;

IMPORT InOut;

VAR
  A, B: INTEGER;

BEGIN
  InOut.ReadInt(A);
  InOut.ReadInt(B);
  InOut.WriteInt(A, 1);

  IF A < B THEN
    InOut.WriteString(' is less than ')
  ELSIF A = B THEN
    InOut.WriteString(' is equal to ')
  ELSE
    InOut.WriteString(' is greater than ')
  END;
  InOut.WriteInt(B, 1);
  InOut.WriteLn
END IntCompare.


MODULE Main;

FROM IO  IMPORT Put, GetInt;
FROM Fmt IMPORT Int;

VAR a,b: INTEGER;

BEGIN
  a := GetInt();
  b := GetInt();
  IF a < b THEN
    Put(Int(a) & " is less than " & Int(b) & "\n");
  ELSIF a = b THEN
    Put(Int(a) & " is equal to " & Int(b) & "\n");
  ELSIF a > b THEN
    Put(Int(a) & " is greater than " & Int(b) & "\n");
  END;
END Main.


INTCOMP
 NEW A,B
INTCOMPREAD
 READ !,"Enter an integer to test: ",A
 READ !,"Enter another integer: ",B
 IF (+A\1'=A)!(+B\1'=B) WRITE !!,"Please enter two integers.",! GOTO INTCOMPREAD
 IF A<B WRITE !,A," is less than ",B
 IF A=B WRITE !,A," is equal to ",B
 IF A>B WRITE !,A," is greater than ",B
 KILL A,B
 QUIT


print "enter first integer:  "
first = int(input())
print "enter second integer: "
second = int(input())

if first = second
	println "the two integers are equal"
else if first < second
	println first + " is less than " + second
else if first > second
	println first + " is greater than " + second
end


using System;
using System.Console;

module IntComp
{
    Main() : void
    {
        def ReadInt() : int {Int32.Parse(ReadLine())}
        def WriteResult(x : int, y : int, res : string) : void
        {WriteLine($"$x is $res $y")}

        def a = ReadInt();
        def b = ReadInt();

        match(a)
        {
            |a when a > b  => WriteResult(a, b, "greater than")
            |a when a < b  => WriteResult(a, b, "less than")
            |a when a == b => WriteResult(a, b, "equal to")
        }

        def x = a.CompareTo(b);

        match(x)
        {
            |x when x > 0  => WriteResult(a, b, "greater than")
            |x when x < 0  => WriteResult(a, b, "less than")
            |x when x == 0 => WriteResult(a, b, "equal to")
        }
    }
}


/* NetRexx */
options replace format comments java crossref symbols nobinary

numL = 0
numR = 0
loop label running forever
  say 'Provide two integers [or anything else to stop]:'
  parse ask numL numR .
  if \numL.datatype('w') | \numR.datatype('w') then leave running
  if numL < numR then say numL 'is less than' numR
  if numL = numR then say numL 'is equal to' numR
  if numL > numR then say numL 'is greater than' numR
  end running

return


(print "Please enter the first number: ")
(set 'A (int (read-line)))
(print "Please enter the second number: ")
(set 'B (int (read-line)))
(println
"The first one is "
    (cond
        ((> A B) "greater than")
        ((= A B) "equal to")
        (true "less than"))
" the second.")


T Animal
{
}
T Dog(Animal)
{
}
T Cat(Animal)
{
}
T Lab(Dog)
{
}
T Collie(Dog)
{
}


import rdstdin, strutils
var a = parseInt(readLineFromStdin "Enter value of a: ")
var b = parseInt(readLineFromStdin "Enter value of b: ")

if a < b:
  echo "a is less than b"
elif a > b:
  echo "a is greater than b"
elif a == b:
  echo "a is equal to b"


Function IntergerComparison
	Push $0
	Push $1
	StrCpy $0 8
	StrCpy $1 2

	IntCmp $0 $1 Equal Val1Less Val1More

Equal:
	DetailPrint "$0 = $1"
	Goto End
Val1Less:
	DetailPrint "$0 < $1"
	Goto End
Val1More:
	DetailPrint "$0 > $1"
	Goto End
End:

	Pop $1
	Pop $0
FunctionEnd


MODULE Compare;

   IMPORT In, Out;

   VAR a,b: INTEGER;

BEGIN
   In.Int(a);
   In.Int(b);
   IF a < b THEN
      Out.Int(a,0);
      Out.String(" is less than ");
      Out.Int(b,0);
      Out.Ln;
   ELSIF a = b THEN
      Out.Int(a,0);
      Out.String(" is equal to ");
      Out.Int(b,0);
      Out.Ln;
   ELSIF a > b THEN
      Out.Int(a,0);
      Out.String(" is greater than ");
      Out.Int(b,0);
      Out.Ln;
   END;
END Compare.


package Inheritance is
   type Animal is tagged private;
   type Dog is new Animal with private;
   type Cat is new Animal with private;
   type Lab is new Dog with private;
   type Collie is new Dog with private;
private
   type Animal is tagged null record;
   type Dog is new Animal with null record;
   type Cat is new Animal with null record;
   type Lab is new Dog with null record;
   type Collie is new Dog with null record;
end Inheritance;


class Animal{
   //functions go here...
}


OBJECT animal
ENDOBJECT

OBJECT dog OF animal
ENDOBJECT

OBJECT cat OF animal
ENDOBJECT

OBJECT lab OF dog
ENDOBJECT

OBJECT collie OF dog
ENDOBJECT


script Animal
end script

script Dog
    property parent : Animal
end script

script Cat
    property parent : Animal
end script

script Lab
    property parent : Dog
end script

script Collie
    property parent : Dog
end script


bundle Default {
  class IntCompare {
    function : Main(args : String[]) ~ Nil {
      a := Console->GetInstance()->ReadString()->ToInt();
      b := Console->GetInstance()->ReadString()->ToInt();

      if (a < b) {
        Console->GetInstance()->Print(a)->Print(" is less than ")->PrintLine(b);
      };

      if (a = b) {
        Console->GetInstance()->Print(a)->Print(" is equal than ")->PrintLine(b);
      };

      if (a > b) {
        Console->GetInstance()->Print(a)->Print(" is greater than ")->PrintLine(b);
      };
    }
  }
}


let my_compare a b =
  if      a < b then "A is less than B"
  else if a > b then "A is greater than B"
  else if a = b then "A equals B"
  else "cannot compare NANs"

let () =
  let a = read_int ()
  and b = read_int () in
  print_endline (my_compare a b)


dog := new Collie
MsgBox, % "A " dog.__Class " is a " dog.base.base.__Class " and is part of the " dog.kingdom " kingdom."

class Animal {
   static kingdom := "Animalia" ; Class variable
}
class Dog extends Animal {
}
class Cat extends Animal {
}
class Lab extends Dog {
}
class Collie extends Dog {
}


      INSTALL @lib$+"CLASSLIB"

      DIM Animal{method}
      PROC_class(Animal{})

      DIM Cat{method}
      PROC_inherit(Cat{}, Animal{})
      PROC_class(Cat{})

      DIM Dog{method}
      PROC_inherit(Dog{}, Animal{})
      PROC_class(Dog{})

      DIM Labrador{method}
      PROC_inherit(Labrador{}, Dog{})
      PROC_class(Labrador{})

      DIM Collie{method}
      PROC_inherit(Collie{}, Dog{})
      PROC_class(Collie{})


class Animal
{
  // ...
};

class Dog: public Animal
{
  // ...
};

class Lab: public Dog
{
  // ...
};

class Collie: public Dog
{
  // ...
};

class Cat: public Animal
{
  // ...
};


printf("Enter a: ");
a = scanf("%d", "C");
printf("Enter b: ");
b = scanf("%d", "C");
if (a > b)
  disp("a greater than b");
elseif (a == b)
  disp("a equal to b");
elseif (a < b)
  disp("a less than b");
endif


import: console

: cmpInt
| a b |
   doWhile: [ System.Console askln asInteger dup ->a isNull ]
   doWhile: [ System.Console askln asInteger dup ->b isNull ]

   a b <  ifTrue: [ System.Out a << " is less than " << b << cr ]
   a b == ifTrue: [ System.Out a << " is equal to " << b << cr ]
   a b >  ifTrue: [ System.Out a << " is greater than " << b << cr ] ;


(define (compare a b)
  (cond ((< a b) "A is less than B")
        ((> a b) "A is greater than B")
        ((= a b) "A equals B")))

(print (compare 1 2))
; ==> A is less than B

(print (compare 2 2))
; ==> A equals B

(print (compare 3 2))
; ==> A is greater than B

; manual user input:
(print (compare (read) (read)))


public class Drums{
   //functions go here...
}


(gen-class :name Animal)
(gen-class :name Dog :extends Animal)
(gen-class :name Cat :extends Animal)
(gen-class :name Lab :extends Dog)
(gen-class :name Collie :extends Dog)


       CLASS-ID. Animal.
           *> ...
       END CLASS Animal.

       CLASS-ID. Dog INHERITS Animal.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Animal.

           *> ...
       END CLASS Dog.

       CLASS-ID. Cat INHERITS Animal.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Animal.

           *> ...
       END CLASS Cat.

       CLASS-ID. Lab INHERITS Dog.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Dog.

           *> ...
       END CLASS Lab.

       CLASS-ID. Collie INHERITS Dog.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       REPOSITORY.
           CLASS Dog.

           *> ...
       END CLASS Collie.


class Animal
class Cat extends Animal
class Dog extends Animal
class Lab extends Dog
class Collie extends Dog


       STRUC Animal
           DIM Species$ OF 20
       ENDSTRUC Animal

       STRUC Dog
              INHERIT Animal
              DIM Race$ OF 20
              FUNC New CONSTRUCTOR
                     Species$="Dog"
              ENDFUNC New
       ENDSTRUC Dog

       STRUC Cat
              INHERIT Animal
              DIM Race$ OF 20
              FUNC New CONSTRUCTOR
                     Species$="Cat"
              ENDFUNC New
       ENDSTRUC Cat

       STRUC Lab
              INHERIT Dog
              FUNC New CONSTRUCTOR
                     Race$:="Lab"
              ENDFUNC New
       ENDSTRUC Lab

       STRUC Collie
              INHERIT Dog
              FUNC New CONSTRUCTOR
                     Race$:="Collie"
              ENDFUNC New
       ENDSTRUC Collie


functor
import
  Application(exit)
  Open(text file)
define

Txt = class from Open.file Open.text end
Stdout = {New Open.file init(name:stdout)}
Stdin  = {New Txt init(name:stdin)}

proc{Print Msg}
  {Stdout write(vs:Msg)}
end

fun{GetInt Prompt}
  {Print Prompt}
  {StringToInt {Stdin getS($)}}
end

Int1 = {GetInt "Enter 1st Integer:"}
Int2 = {GetInt "Enter 2nd Integer:"}

if(Int1  < Int2) then {Print Int1#" less than "#Int2} end
if(Int1  > Int2) then {Print Int1#" greater than "#Int2} end
if(Int1 == Int2) then {Print Int1#" equal to "#Int2} end

{Application.exit 0}
end


a=input();
b=input();
if(a<b, print(a" < "b));
if(a==b, print(a" = "b));
if(a>b, print(a" > "b));


(defclass animal ()       ())
(defclass dog    (animal) ())
(defclass lab    (dog)    ())
(defclass collie (dog)    ())
(defclass cat    (animal) ())


	TYPE
		Animal = ABSTRACT RECORD (*  *) END;
		Cat = RECORD (Animal)  (*  *) END; (* final record (cannot be extended) - by default *)
		Dog = EXTENSIBLE RECORD (Animal)  (*  *) END; (* extensible record *)
		Lab = RECORD (Dog)  (*  *) END;
		Collie = RECORD (Dog)  (*  *) END;


class Animal {
    // ...
}

class Dog: Animal {
    // ...
}

class Lab: Dog {
    // ...
}

class Collie: Dog {
    // ...
}

class Cat: Animal {
    // ...
}

void main() {}


type
  Animal = class(TObject)
  private
    // private functions/variables
  public
    // public functions/variables
  end;

  Dog = class(Animal);
  Cat = class(Animal);
  Collie = class(Dog);
  Lab = class(Dog);


program compare(input, output);

var
 a, b: integer;

begin
  write('Input an integer number: ');
  readln(a);
  write('Input another integer number: ');
  readln(b);
  if (a < b) then writeln(a, ' is less than ', b);
  if (a = b) then writeln(a, ' is equal to ', b);
  if (a > b) then writeln(a, ' is greater than ', b);
end.


sub test_num {
    my $f = shift;
    my $s = shift;
    if ($f < $s){
        return -1; # returns -1 if $f is less than $s
    } elsif ($f > $s) {
        return 1; # returns 1 if $f is greater than $s
    } elsif ($f == $s) {
# = operator is an assignment
# == operator is a numeric comparison
       return 0; # returns 0 $f is equal to $s
    };
};


type
  Animal = class(TObject)
  private
    // private functions/variables
  public
    // public functions/variables
  end;

type Dog = class(Animal) end;
type Cat = class(Animal) end;
type Collie = class(Dog) end;
type Lab = class(Dog) end;


def makeType(label, superstamps) {
    def stamp {
        to audit(audition) {
            for s in superstamps { audition.ask(s) }
            return true
        }
    }
    def guard {
        to coerce(specimen, ejector) {
            if (__auditedBy(stamp, specimen)) {
                return specimen
            } else {
                throw.eject(ejector, `$specimen is not a $label`)
            }
        }
    }
    return [guard, stamp]
}


class Animal
{
  // ...
}

class Dog : Animal
{
  // ...
}

class Lab : Dog
{
  // ...
}

class Collie : Dog
{
  // ...
}

class Cat : Animal
{
  // ...
}


atom a = prompt_number("first number:",{}),
     b = prompt_number("second number:",{})

printf(1,"%g is ",a)
if a < b then
    puts(1,"less than")
elsif a = b then
    puts(1,"equal to")
elsif a > b then
    puts(1,"greater than")
end if
printf(1," %g",b)


module intergertest;

extern printf;
extern scanf;

@Integer main [
	var a = 0;
	var b = 0;
	scanf("%i %i", ref (a), ref (b));

	if (a < b)
		printf("%i is less than %i\n", a::get, b::get);

	if (a == b)
		printf("%i is equal to %i\n", a::get, b::get);

	if (a > b)
		printf("%i is greater than %i\n", a::get, b::get);

	return 0;
]


<?php

echo "Enter an integer [int1]: ";
fscanf(STDIN, "%d\n", $int1);
if(!is_numeric($int1)) {
  echo "Invalid input; terminating.\n";
  exit(1);      // return w/ general error
}

echo "Enter an integer [int2]: ";
fscanf(STDIN, "%d\n", $int2);
if(!is_numeric($int2)) {
  echo "Invalid input; terminating.\n";
  exit(1);      // return w/ general error
}

// now $int1 and $int2 are numbers.
// for simplicity, this does not explicitly examine types

if($int1 < $int2)
  echo "int1 < int2\n";
if($int1 == $int2)
  echo "int1 = int2\n";
if($int1 > $int2)
  echo "int1 > int2\n";

?>


type Animal() =
  class  // explicit syntax needed for empty class
  end

type Dog() =
  inherit Animal()

type Lab() =
  inherit Dog()

type Collie() =
  inherit Dog()

type Cat() =
  inherit Animal()


TUPLE: animal ;
TUPLE: dog < animal ;
TUPLE: cat < animal ;
TUPLE: lab < dog ;
TUPLE: collie < dog ;


class Animal {
  # ...
}

class Dog : Animal {
  # ...
}

class Cat : Animal {
  # ...
}

class Lab : Dog {
  # ...
}

class Collie : Dog {
  # ...
}


class Animal
{
}

class Dog : Animal
{
}

class Cat : Animal
{
}

class Lab : Dog
{
}

class Collie : Dog
{
}


include 4pp/lib/foos.4pp

:: Animal class end-class {} ;
:: Dog extends    Animal end-extends {} ;
:: Cat extends    Animal end-extends {} ;
:: Lab extends    Dog    end-extends {} ;
:: Collie extends Dog    end-extends {} ;


module anim

  type animal
  end type animal

  type, extends(animal) :: dog
  end type dog

  type, extends(animal) :: cat
  end type cat

  type, extends(dog) :: lab
  end type lab

  type, extends(dog) :: collie
  end type collie

end module anim


(prin "Please enter two values: ")

(in NIL  # Read from standard input
   (let (A (read)  B (read))
      (prinl
         "The first one is "
         (cond
            ((> A B) "greater than")
            ((= A B) "equal to")
            (T "less than") )
         " the second." ) ) )


int main(int argc, array(int) argv){
   if(argc != 3){
      write("usage: `pike compare-two-ints.pike <x> <y>` where x and y are integers.\n");
      return 0;
   }

   int a = argv[1];
   int b = argv[2];

   if(a > b) {
      write(a + " is greater than " + b + "\n");
   } else if (a < b) {
      write(a + " is less than " + b + "\n");
   } else {
      write(a + " is equal to " + b + "\n");
   }
}


' FB 1.05.0 Win64

Type Animal Extends Object ' to enable virtual methods etc. if needed
  ' ...
End Type

Type Dog Extends Animal
  ' ...
End Type

Type Cat Extends Animal
  ' ...
End Type

Type Lab Extends Dog
  ' ...
End Type

Type Collie Extends Dog
  ' ...
End Type


package main

type animal struct {
    alive bool
}

type dog struct {
    animal
    obedienceTrained bool
}

type cat struct {
    animal
    litterBoxTrained bool
}

type lab struct {
    dog
    color string
}

type collie struct {
    dog
    catchesFrisbee bool
}

func main() {
    var pet lab
    pet.alive = true
    pet.obedienceTrained = false
    pet.color = "yellow"
}


class Animal{
   //contents go here...
}


class Animal a
class Animal a => Cat a
class Animal a => Dog a
class Dog a => Lab a
class Dog a => Collie a


declare (a, b) fixed binary;

get list (a, b);
if a = b then
   put skip list ('The numbers are equal');
if a > b then
   put skip list ('The first number is greater than the second');
if a < b then
   put skip list ('The second number is greater than the first');


To run:
Start up.
Write "Enter the first number: " to the console without advancing.
Read a first number from the console.
Write "Enter the second number: " to the console without advancing.
Read a second number from the console.
If the first number is less than the second number, write "Less than!" to the console.
If the first number is the second number, write "Equal!" to the console.
If the first number is greater than the second number, write "Greater than!" to the console.
Wait for the escape key.
Shut down.


;;; Comparison procedure
define compare_integers(x, y);
if x > y then
   printf('x is greater than y\n');
elseif x < y then
   printf('x is less than y\n');
elseif x = y then
   printf('x equals y\n');
endif;
enddefine;

;;; Setup token reader
vars itemrep;
incharitem(charin) -> itemrep;

;;; Read numbers and call comparison procedure
compare_integers(itemrep(), itemrep());


$a = [int] (Read-Host a)
$b = [int] (Read-Host b)

if ($a -lt $b) {
    Write-Host $a is less than $b`.
} elseif ($a -eq $b) {
    Write-Host $a is equal to $b`.
} elseif ($a -gt $b) {
    Write-Host $a is greater than $b`.
}


class Animal ()
end

class Dog : Animal  ()
end

class Cat : Animal  ()
end

class Lab : Dog  ()
end

class Collie : Dog ()
end


An animal is a kind of thing.
A cat is a kind of animal.
A dog is a kind of animal.
A collie is a kind of dog.
A lab is a kind of dog.


Animal := Object clone
Cat := Animal clone
Dog := Animal clone
Collie := Dog clone
Lab := Dog clone


public class Animal{
   //functions go here...
}


If OpenConsole()

  Print("Enter an integer: ")
  x.i = Val(Input())
  Print("Enter another integer: ")
  y.i = Val(Input())

  If x < y
    Print( "The first integer is less than the second integer.")
  ElseIf x = y
    Print("The first integer is equal to the second integer.")
  ElseIf x > y
    Print("The first integer is greater than the second integer.")
  EndIf

  Print(#CRLF$ + #CRLF$ + "Press ENTER to exit")
  Input()
  CloseConsole()
EndIf


#!/usr/bin/env python
a = input('Enter value of a: ')
b = input('Enter value of b: ')

if a < b:
    print 'a is less than b'
elif a > b:
    print 'a is greater than b'
elif a == b:
    print 'a is equal to b'


$ "Please enter two numbers separated by a space; "
input quackery cr
say "The first number is "
[ 2dup > iff [ say "larger than" ] done
  2dup = iff [ say "equal to" ] done
  2dup < if  [ say "smaller than" ] ]
2drop
say " the second number." cr


abstract type Animal end
abstract type Dog <: Animal end
abstract type Cat <: Animal end

struct Lab <: Dog end
struct Collie <: Dog end


class Animal [
	#Method goes here
];

class Dog from Animal [
	#Method goes here
];

class Lab from Dog [
	#Method goes here
];

class collie from Dog [
	#Method goes here
];


// version 1.0.6

open class Animal {
    override fun toString() = "animal"
}

open class Dog : Animal() {
    override fun toString() = "dog"
}

class Cat : Animal() {
    override fun toString() = "cat"
}

class Labrador : Dog() {
    override fun toString() = "labrador"
}

class Collie : Dog() {
    override fun toString() = "collie"
}

fun main(args: Array<String>) {
    val felix: Animal = Cat()
    val rover: Animal = Dog()
    val bella: Dog = Labrador()
    val casey: Dog = Collie()
    println("Felix is a $felix")
    println("Rover is a $rover")
    println("Bella is a $bella")
    println("Casey is a $casey")
}


define animal => type {
	data public gender::string
}

define dog => type {
	parent animal
}

define cat => type {
	parent animal
}

define collie => type {
	parent dog
}

define lab => type {
	parent dog
}

local(myanimal = lab)

#myanimal -> gender = 'Male'
#myanimal -> gender


Animal ::= Object clone tap {
  ;; Methods go here...
}.

Dog ::= Animal clone tap {
  ;; Methods go here...
}.

Cat ::= Animal clone tap {
  ;; Methods go here...
}.

Lab ::= Dog clone tap {
  ;; Methods go here...
}.

Collie ::= Dog clone tap {
  ;; Methods go here...
}.


print("insert number a")
a <- scan(what=numeric(0), nmax=1)
print("insert number b")
b <- scan(what=numeric(0), nmax=1)
if ( a < b ) {
  print("a is less than b")
} else if ( a > b ) {
  print("a is greater than b")
} else if ( a == b ) { # could be simply else of course...
  print("a and b are the same")
}


#lang racket
(define (compare-two-ints a b)
  (define compared
    (cond ((> a b) "is greated than")
          ((= a b) "equals")
          ((< a b) "is lesser than")))
  (format "~a ~a ~a" a compared b))

(compare-two-ints (read) (read))


my $a = prompt("1st int: ").floor;
my $b = prompt("2nd int: ").floor;

if $a < $b {
    say 'Less';
}
elsif $a > $b {
    say 'Greater';
}
elsif $a == $b {
    say 'Equal';
}


:- object(thing,
    instantiates(thing)).
:- end_object.

:- object(animal,
    specializes(thing)).
    ...
:- end_object.

:- object(dog,
    specializes(animal)).
    ...
:- end_object.

:- object(cat,
    specializes(animal)).
    ...
:- end_object.

:- object(lab,
    specializes(dog)).
    ...
:- end_object.

:- object(collie,
    specializes(dog)).
    ...
:- end_object.


Class = {
  classname = "Class aka Object aka Root-Of-Tree",
  new = function(s,t)
    s.__index = s
    local instance = setmetatable(t or {}, s)
    instance.parent = s
    return instance
  end
}

Animal = Class:new{classname="Animal", speak=function(s) return s.voice or "("..s.classname.." has no voice)" end }
Cat = Animal:new{classname="Cat", voice="meow"}
Dog = Animal:new{classname="Dog", voice="woof"}
Lab = Dog:new{classname="Lab", voice="bark"}
Collie = Dog:new{classname="Collie"}  -- subclass without a unique voice

print("Animal:speak():  " .. Animal:speak())
print("Cat:speak():  " .. Cat:speak())
print("Dog:speak():  " .. Dog:speak())
print("Lab:speak():  " .. Lab:speak())
print("Collie:speak():  " .. Collie:speak())

max = Collie:new{voice="Hi, I am Max the talking Collie!"} -- instance with a unique voice
print("max:speak():  " .. max:speak())
print("max himself is (instance):  " .. max.classname)
print("max's parent is (class):  " .. max.parent.classname)
print("max's parent's parent is (class):  " .. max.parent.parent.classname)
print("max's parent's parent's parent is (class):  " .. max.parent.parent.parent.classname)
print("max's parent's parent's parent's parent is (class):  " .. max.parent.parent.parent.parent.classname)
print("max's parent's parent's parent's parent's parent is (nil reference):  " .. tostring(max.parent.parent.parent.parent.parent))


"Enter the first number: "  print
expect trim  1.1 prefer as $a
"Enter the second number: " print
expect trim  1.1 prefer as $b

$a $b < if  $b $a "%g is less than %g\n" print
$a $b > if  $b $a "%g is greater than %g\n" print
$a $b = if  $b $a "%g is equal to %g\n" print


rebol [
	Title: "Comparing Two Integers"
	URL: http://rosettacode.org/wiki/Comparing_two_integers
]

a: ask "First integer? "  b: ask "Second integer? "

relation: [
	a < b "less than"
	a = b "equal to"
	a > b "greater than"
]
print [a "is"  case relation  b]


Red [
    Title: "Comparing Two Integers"
    URL: http://rosettacode.org/wiki/Comparing_two_integers
    Date: 2021-10-25
]

a: to-integer ask "First integer? " b: to-integer ask "Second integer? "

relation: [
    a < b "less than"
    a = b "equal to"
    a > b "greater than"
]
print [a "is" case relation b]


Module CheckIt {
      Class Animal {
      }
      Class Dog as Animal {
      }
      Class Cat as Animal{
      }
      Class Labrador As Dog {
      }
      Class Collie As Dog{
      }
      \\ a is a pointer to a group made from class Labrador
      a->Labrador()
      Print a is type Animal = True
      Print a is type Dog = True
      Print a is type Labrador = True
}
CheckIt


var Animal = $new(null);

var Dog = $new(null);
$objsetproto(Dog, Animal);

var Cat = $new(null);
$objsetproto(Cat, Animal);

var Lab = $new(null);
$objsetproto(Lab, Dog);

var Collie = $new(null);
$objsetproto(Collie, Dog);


class Animal {
    // ...
}

class Dog: Animal {
    // ...
}

class Lab: Dog {
    // ...
}

class Collie: Dog {
    // ...
}

class Cat: Animal {
    // ...
}


/* NetRexx */
options replace format comments java crossref symbols binary

class RInheritSingle public
  method main(args = String[]) public static
    animals = [ -
      RInheritSingle_Animal(), -
      RInheritSingle_Cat(), -
      RInheritSingle_Dog(), -
      RInheritSingle_Lab(), -
      RInheritSingle_Collie() -
      ]

    say 'Object ID'.left(12) 'Class type'.left(24)  'Superclass type'
    say '.'.left(12, '.')    '.'.left(24, '.')      '.'.left(24, '.')
    loop animal over animals
      parse animal.whatAmI() oid ct st
      say oid.left(12) ct.left(24) st
      end animal
    return

class RInheritSingle_Animal private
  properties indirect
    whatThatIs = String
    whatThisIs = String
  method RInheritSingle_Animal() public
    -- Animal specific set-up
    setWhatThatIs(this.getClass().getSuperclass().getSimpleName())
    setWhatThisIs(this.getClass().getSimpleName())
    return
  method hashToString() public
    return '@'(Rexx this.hashCode()).d2x().right(8, 0)
  method whatAmI() public
    iAmText = hashToString() getWhatThisIs() getWhatThatIs()
    return iAmText

class RInheritSingle_Cat private extends RInheritSingle_Animal
  method RInheritSingle_Cat() public
    -- Do Cat specific set-up
    return

class RInheritSingle_Dog private extends RInheritSingle_Animal
  method RInheritSingle_Dog() public
    -- Do Dog specific set-up
    return

class RInheritSingle_Lab private extends RInheritSingle_Dog
  method RInheritSingle_Lab() public
    -- Do Lab specific set-up
    return

class RInheritSingle_Collie private extends RInheritSingle_Dog
  method RInheritSingle_Collie() public
    -- Do Collie specific set-up
    return


let my_compare = (a, b) => {
  if a < b { "A is less than B" } else
  if a > b { "A is greater than B" } else
  if a == b { "A equals B" }
  else { "cannot compare NANs" }
}

let a = int_of_string(Sys.argv[2])
let b = int_of_string(Sys.argv[3])

Js.log(my_compare(a, b))


:example (ab-)
  dup-pair gt? [ 'A>B s:put nl ] if
  dup-pair lt? [ 'A<B s:put nl ] if
           eq? [ 'A=B s:put nl ] if ;


/*REXX program  prompts  for  two integers,   compares them,  and  displays the results.*/
numeric digits 2000                              /*for the users that really go ka─razy.*/
@=copies('─', 20)                                /*eyeball catcher for the user's eyen. */
a=getInt(@  'Please enter your 1st integer:')    /*obtain the 1st integer from the user.*/
b=getInt(@  'Please enter your 2nd integer:')    /*   "    "  2nd    "      "   "    "  */
say
      if a<b  then say  @   a    ' is less than '        b
      if a=b  then say  @   a    ' is equal to '         b
      if a>b  then say  @   a    ' is greater than '     b
exit                                             /*stick a fork in it,  we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
getInt:       do forever;     say                /*keep prompting the user until success*/
                              say arg(1)         /*display the prompt message to console*/
              parse pull x                       /*obtain  X,  and keep its case intact.*/
                 select
                 when x=''               then call serr "No argument was entered."
                 when words(x)>1         then call serr 'Too many arguments entered.'  x
                 when \datatype(x, 'N')  then call serr "Argument isn't numeric:"      x
                 when \datatype(x, 'W')  then call serr "Argument isn't an integer:"   x
                 otherwise    return x           /* [↑]  Eureka!   Return # to invoker. */
                 end   /*select*/
              end      /*forever*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
serr:  say @  '***error*** '    arg(1);        say @  "Please try again.";          return


type
  Animal = object of RootObj
  Dog    = object of Animal
  Cat    = object of Animal
  Lab    = object of Dog
  Collie = object of Dog


MODULE Animals;

   TYPE
      Animal = RECORD END;
      Dog = RECORD (Animal) END;
      Cat = RECORD (Animal) END;
      Lab = RECORD (Dog) END;
      Collie = RECORD (Dog) END;

END Animals.


MODULE Animals;
TYPE
  Animal = POINTER TO AnimalDesc;
  AnimalDesc = RECORD END;

  Cat = POINTER TO CatDesc;
  CatDesc = RECORD (AnimalDesc) END;

  Dog = POINTER TO DogDesc;
  DogDesc = RECORD (AnimalDesc) END;

  Lab = POINTER TO LabDesc;
  LabDesc = RECORD (DogDesc) END;

  Collie = POINTER TO CollieDesc;
  CollieDesc = RECORD (DogDesc) END;

END Animals.


class Animal
{ #~ ... ~# }

class Dog from Animal
{ #~ ... ~# }

class Lab from Dog
{ #~ ... ~# }

class Collie from Dog
{ #~ ... ~# }

class Cat from Animal
{ #~ ... ~# }


@interface Animal : NSObject
{
  // ...
}
// ...
@end

@interface Dog : Animal
{
  // ...
}
// ...
@end

@interface Lab : Dog
{
  // ...
}
// ...
@end

@interface Collie : Dog
{
  // ...
}
// ...
@end

@interface Cat : Animal
{
  // ...
}
// ...
@end


Func Compare a,b
   if a < b
      See "A is less than B"
   but a > b
      See "A is more than B"
   else
      See "A equals B"
   ok


(Get two numbers from user)
Listen to Number One
Listen to Number Two
(Check if n1 > n2)
If Number One is greater than Number Two
Say "The first is greater than the second"

(Check if n1 = n2)
If Number One is Number Two
Say "The Numbers are equal"

(Check if n1 < n2)
If Number One is less than Number Two
Say "The first is less than the second"


     h dftactgrp(*no)

     d                 pi
     d integer1                      10i 0
     d integer2                      10i 0

     d message         s             50a

       if integer1 < integer2;
         message = 'Integer 1 is less than integer 2';
       endif;

       if integer1 > integer2;
         message = 'Integer 1 is greater than integer 2';
       endif;

       if integer1 = integer2;
         message = 'Integer 1 is equal to integer 2';
       endif;

       dsply message;
       *inlr = *on;


class animal =
  object (self)
    (*functions go here...*)
  end


Object Class new: Animal
Animal Class new: Cat
Animal Class new: Dog
Dog Class new: Lab
Dog Class new: Collie


-- subclass of object by default
::class animal

::class cat subclass animal

::class dog subclass animal

::class lab subclass dog

::class collie subclass dog


class animal
  method show() as string
  return "Animal "
  end method
end Class

class dog
  from Animal
  method show() as string
  return animal.show()+"dog "
  end method
end Class

class cat
  from animal
  method show() as string
  return animal.show()+"cat "
  end method
end Class

class Lab
  from dog
  method show() as string
  return dog.show()+"Lab "
  end method
end Class

class Collie
  from dog
  method show() as string
  return dog.show()+"Collie "
  end method
end Class

Collie c
print c.show 'result: Animal Dog Collie


class Animal
   %% ...
end

class Dog from Animal
   %% ...
end

class Lab from Dog
   %% ...
end

class Collie from Dog
   %% ...
end

class Cat from Animal
   %% ...
end


package Animal;
#functions go here...
1;


a = (print "enter a value for a: "; gets).to_i
b = (print "enter a value for b: "; gets).to_i

puts "#{a} is less than #{b}" if a < b
puts "#{a} is greater than #{b}" if a > b
puts "#{a} is equal to #{b}" if a == b


input "1st number:"; n1
input "2nd number:"; n2

if n1 < n2 then print "1st number ";n1;" is less than 2nd number";n2
if n1 > n2 then print "1st number ";n1;" is greater than 2nd number";n2
if n1 = n2 then print "1st number ";n1;" is equal to 2nd number";n2


use std::io::{self, BufRead};

fn main() {
    let mut reader = io::stdin();
    let mut buffer = String::new();
    let mut lines = reader.lock().lines().take(2);
    let nums: Vec<i32>= lines.map(|string|
        string.unwrap().trim().parse().unwrap()
        ).collect();
    let a: i32 = nums[0];
    let b: i32 = nums[1];
    if a < b {
        println!("{} is less than {}" , a , b)
    } else if a == b {
        println!("{} equals {}" , a , b)
    } else if a > b {
        println!("{} is greater than {}" , a , b)
    };
}


without js -- (class)
class Animal
    private string species
end class
class Dog extends Animal
    public procedure bark()
        puts(1,"woof\n")
    end procedure
end class
class Lab extends Dog end class
class Collie extends Dog end class
class Cat extends Animal end class


class Animal {
   // functions go here...
}

class Dog extends Animal {
   // functions go here...
}

class Cat extends Animal {
   // functions go here...
}

class Lab extends Dog {
   // functions go here...
}

class Collie extends Dog {
   // functions go here...
}


(class +Animal)

(class +Dog +Animal)

(class +Cat +Animal)

(class +Lab +Dog)

(class +Collie +Dog)


class Animal {}
class Dog : Animal {}
class Cat: Animal {}
class Lab : Dog {}
class Collie : Dog {}


Interface Animal
  Eat()
  Sleep()
EndInterface

Interface Cat Extends Animal
  ChaseMouse()
EndInterface

Interface Dog Extends Animal
  Bark()
  WagTail()
EndInterface

Interface Lab Extends Dog
  Swim()
EndInterface

Interface Collie Extends Dog
  HeardSheep()
EndInterface


/* Showing operators and their fortran-like equivalents. Note that ~= and ^= both mean "different" */
data _null_;
input a b;
put a= b=;
if a = b then put "a = b";
if a ^= b then put "a ^= b";
if a ~= b then put "a ~= b";
if a < b then put "a < b";
if a > b then put "a > b";
if a <= b then put "a <= b";
if a >= b then put "a >= b";
if a eq b then put "a eq b";
if a ne b then put "a ne b";
if a lt b then put "a lt b";
if a gt b then put "a gt b";
if a le b then put "a le b";
if a ge b then put "a ge b";
cards;
1 2
2 1
1 1
;
run;


object IntCompare {
  def main(args: Array[String]): Unit = {
    val a=Console.readInt
    val b=Console.readInt
    if (a < b)
      printf("%d is less than %d\n", a, b)
    if (a == b)
      printf("%d is equal to %d\n", a, b)
    if (a > b)
      printf("%d is greater than %d\n", a, b)
  }
}


(define (my-compare a b)
  (cond ((< a b) "A is less than B")
        ((> a b) "A is greater than B")
        ((= a b) "A equals B")))

(my-compare (read) (read))


class Animal:
  pass #functions go here...

class Dog(Animal):
  pass #functions go here...

class Cat(Animal):
  pass #functions go here...

class Lab(Dog):
  pass #functions go here...

class Collie(Dog):
  pass #functions go here...


aCollie <- "woof"
class(aCollie) <- c("Collie", "Dog", "Animal")


#lang racket

(define animal% (class object% (super-new)))
(define dog%    (class animal% (super-new)))
(define cat%    (class animal% (super-new)))
(define lab%    (class dog% (super-new)))
(define collie% (class dog% (super-new)))

;; unit tests
(require rackunit)

(check-true (is-a? (new dog%) animal%))
(check-false (is-a? (new collie%) cat%))


class Animal {}
class Dog is Animal {}
class Cat is Animal {}
class Lab is Dog {}
class Collie is Dog {}

say Collie.^parents;     # undefined type object
say Collie.new.^parents; # instantiated object


rebol [
	Title: "Inheritance"
	URL: http://rosettacode.org/wiki/Inheritance
]

; REBOL provides subclassing through its prototype mechanism:

Animal: make object! [
	legs: 4
]

Dog: make Animal [
	says: "Woof!"
]
Cat: make Animal [
	says: "Meow..."
]

Lab: make Dog []
Collie: make Dog []

; Demonstrate inherited properties:

print ["Cat has" Cat/legs "legs."]

print ["Lab says:" Lab/says]


Class Animal
Class Dog from Animal
Class Cat from Animal
Class Lab from Dog
Class Collie from Dog


$ include "seed7_05.s7i";

const proc: main is func
  local
    var integer: a is 0;
    var integer: b is 0;
  begin
    readln(a);
    readln(b);

    if a < b then
      writeln(a <& " is less than " <& b);
    end if;

    if a = b then
      writeln(a <& " is equal to " <& b);
    end if;

    if a > b then
      writeln(a <& " is greater than " <& b);
    end if;
  end func;


Ask "Provide Any Number"

Put It into A

Ask " Provide Another Number"

Put it into B

if A  is less than B
	Put   A&" Is less than  "  &B
end if

if A  is greater than B
	Put  A&  " is Greater than " &B
end if

If A is Equal to B
	Put A& " is Equal to " &B
End If


var a = read("a: ", Number);
var b = read("b: ", Number);

if (a < b) {
    say 'Lower';
}
elsif (a == b) {
    say 'Equal';
}
elsif (a > b) {
    say 'Greater';
}


class Animal
  #functions go here...
  def self.inherited(subclass)
    puts "new subclass of #{self}: #{subclass}"
  end
end

class Dog < Animal
  #functions go here...
end

class Cat < Animal
  #functions go here...
end

class Lab < Dog
  #functions go here...
end

class Collie < Dog
  #functions go here...
end


trait Animal {}
trait Cat: Animal {}
trait Dog: Animal {}
trait Lab: Dog {}
trait Collie: Dog {}


class Animal
class Dog extends Animal
class Cat extends Animal
class Lab extends Dog
class Collie extends Dog


$ include "seed7_05.s7i";

const type: Animal is new struct
    # ...
  end struct;

const type: Dog is sub Animal struct
    # ...
  end struct;

const type: Lab is sub Dog struct
    # ...
  end struct;

const type: Collie is sub Dog struct
    # ...
  end struct;

const type: Cat is sub Animal struct
    # ...
  end struct;


class Animal {};
class Dog << Animal {};
class Cat << Animal {};
class Lab << Dog {};
class Collie << Dog {};


begin

    class Animal;
        ! instance variables;
    begin
        ! methods;
    end;

    Animal class Dog;
    begin
    end;

    Animal class Cat;
    begin
    end;

    Dog class Lab;
    begin
    end;

    Dog class Collie;
    begin
    end;

end


[ |:a :b |

 ( a > b ) ifTrue: [ inform: 'a greater than b\n' ].
 ( a < b ) ifTrue: [ inform: 'a less than b\n' ].
 ( a = b ) ifTrue: [ inform: 'a is equal to b\n' ].

] applyTo: {Integer readFrom: (query: 'Enter a: '). Integer readFrom: (query: 'Enter b: ')}.


| a b |
'a = ' display. a := (stdin nextLine asInteger).
'b = ' display. b := (stdin nextLine asInteger).
( a > b ) ifTrue: [ 'a greater than b' displayNl ].
( a < b ) ifTrue: [ 'a less than b' displayNl ].
( a = b ) ifTrue: [ 'a is equal to b' displayNl ].


*       # Get user input
        output = 'Enter X,Y:'
        trim(input) break(',') . x ',' rem . y

        output = lt(x,y) x ' is less than ' y :s(end)
        output = eq(x,y) x ' is equal to '  y :s(end)
        output = gt(x,y) x ' is greater than ' y
end


define: #Animal &parents: {Cloneable}.
define: #Dog &parents: {Animal}.
define: #Cat &parents: {Animal}.
define: #Lab &parents: {Dog}.
define: #Collie &parents: {Dog}.


Object subclass: #Animal
  instanceVariableNames: ' ' "* space separated list of names *"
  classVariableNames: ' '
  poolDictionaries: ' '
  category: ' ' !

"* declare methods here, separated with '!' *"
"* !Animal methodsFor: 'a category'! *"
"* methodName *"
"*    method body! !"

!Animal subclass: #Dog
   "* etc. *" !

!Animal subclass: #Cat
  "* etc. *" !

!Dog subclass: #Lab
  "* etc. *" !

!Dog subclass: #Collie
  "* etc. *" !


class Animal {
  // ...
}

class Dog : Animal {
  // ...
}

class Lab : Dog {
  // ...
}

class Collie : Dog {
  // ...
}

class Cat : Animal {
  // ...
}


package require TclOO
oo::class create Animal {
   # ...
}
oo::class create Dog {
   superclass Animal
   # ...
}
oo::class create Cat {
   superclass Animal
   # ...
}
oo::class create Collie {
   superclass Dog
   # ...
}
oo::class create Lab {
   superclass Dog
   # ...
}


@(defex cat animal)
@(defex lab dog animal)
@(defex collie dog)


Class Animal
  ' ...
End Class

Class Dog
  Inherits Animal
  ' ...
End Class

Class Lab
  Inherits Dog
  ' ...
End Class

Class Collie
  Inherits Dog
  ' ...
End Class

Class Cat
  Inherits Animal
  ' ...
End Class


pet = new()
cat = new(pet)
dog = new(pet)
fido = new(dog)
felix = new(cat)


let a = 13, b = 37;
if a < b {
    print("a < b");
} else if a > b {
    print("a > b");
} else if a == b {
    print("a == b");
} else {
    print("either a or b or both are NaN");
}


DROP TABLE test;

CREATE TABLE test(a INTEGER, b INTEGER);

INSERT INTO test VALUES (1,2);

INSERT INTO test VALUES (2,2);

INSERT INTO test VALUES (2,1);

SELECT to_char(a)||' is less than '||to_char(b) less_than
FROM test
WHERE a < b;

SELECT to_char(a)||' is equal to '||to_char(b) equal_to
FROM test
WHERE a = b;

SELECT to_char(a)||' is greater than '||to_char(b) greater_than
FROM test
WHERE a > b;


class Animal {
    // methods
}

class Dog is Animal {
    // methods
}

class Cat is Animal {
    // mwethods
}

class Labrador is Dog {
    // methods
}

class Collie is Dog {
    // methods
}


(define-class animal)

(define-class dog
    (super-class animal))

(define-class cat
    (super-class animal))

(define-class collie
    (super-class dog))

(define-class lab
    (super-class dog))


class Animal{}
class Dog(Animal){} class Cat(Animal){}
class Lab(Dog){} class Collie(Dog){}
Collie.linearizeParents


CREATE TABLE TEST (
  VAL1 INT,
  VAL2 INT
);
INSERT INTO TEST (VAL1, VAL2) VALUES
  (1, 2),
  (2, 2),
  (2, 1);
SELECT
  CASE
     WHEN VAL1 < VAL2 THEN VAL1 || ' less than ' || VAL2
     WHEN VAL1 = VAL2 THEN VAL1 || ' equal to ' || VAL2
     WHEN VAL1 > VAL2 THEN VAL1 || ' greater than ' || VAL2
  END COMPARISON
FROM TEST;


            accumulator := a - b;
            if accumulator >= 0 then
                (* a is not less than b, so *)
                goto next_test
            else
                goto less;
next_test:  accumulator := accumulator - 1;
            if accumulator >= 0 then
                goto greater
            else
                (* a and b are equal *)
                accumulator := 0;
                halt;
greater:    accumulator := 1;
            halt;
less:       accumulator := -1;
            halt


fun compare_integers(a, b) =
  if a < b then print "A is less than B\n"
  if a > b then print "A is greater than B\n"
  if a = b then print "A equals B\n"

 fun test () =
  let
    open TextIO
    val SOME a = Int.fromString (input stdIn)
    val SOME b = Int.fromString (input stdIn)
  in
    compare_integers (a, b)
  end
    handle Bind => print "Invalid number entered!\n"


import Cocoa

var input = NSFileHandle.fileHandleWithStandardInput()

println("Enter two integers separated by a space: ")

let data = input.availableData
let stringArray = NSString(data: data, encoding: NSUTF8StringEncoding)?.componentsSeparatedByString(" ")
var a:Int!
var b:Int!
if (stringArray?.count == 2) {
    a = stringArray![0].integerValue
    b = stringArray![1].integerValue
}
if (a==b)  {println("\(a) equals \(b)")}
if (a < b) {println("\(a) is less than \(b)")}
if (a > b) {println("\(a) is greater than \(b)")}


puts "Please enter two numbers:"

gets stdin x
gets stdin y

if { $x > $y } { puts "$x is greater than $y" }
if { $x < $y } { puts "$x is less than $y" }
if { $x == $y } { puts "$x equals $y" }


Prompt A,B
If A<B: Disp "A SMALLER B"
If A>B: Disp "A GREATER B"
If A=B: Disp "A EQUAL B"


Local a, b, result
Prompt a, b
If a < b Then
  "<" → result
ElseIf a = b Then
  "=" → result
ElseIf a > b Then
  ">" → result
Else
  "???" → result
EndIf
Disp string(a) & " " & result & " " & string(b)


[ ( a b -- )
  2dup < [ ." a is less than b\n" ] ifTrue
  2dup > [ ." a is greater than b\n" ] ifTrue
       = [ ." a is equal to b\n" ] ifTrue
] is compare-integers

1 1 compare-integers
2 1 compare-integers
1 2 compare-integers


$$ MODE TUSCRIPT

ASK "Please enter your first integer:": i1=""
ASK "Please enter your second integer:": i2=""

IF (i1!='digits'||i2!='digits') ERROR/STOP "Please insert digits"

IF (i1==i2) PRINT i1," is equal to     ",i2
IF (i1<i2)  PRINT i1," is less than    ",i2
IF (i1>i2)  PRINT i1," is greater than ",i2


#!/bin/ksh
# tested with ksh93s+

builtin printf

integer a=0
integer b=0

read a?"Enter value of a: " || { print -u2 "Input of a aborted." ; exit 1 ; }
read b?"Enter value of b: " || { print -u2 "Input of b aborted." ; exit 1 ; }

if (( a < b )) ; then
    printf "%d is less than %d\n" a b
fi
if (( a == b )) ; then
    printf "%d is equal to %d\n" a b
fi
if (( a > b )) ; then
    printf "%d is greater than %d\n" a b
fi

exit 0


decl int first second
out "enter first integer:  " console
set first (in int console)
out "enter second integer: " console
set second (in int console)

if (= first second)
        out "the two integers are equal" endl console
end if
if (< first second)
        out first " is less than " second endl console
end if
if (> first second)
        out first " is greater than " second endl console
end if


[compare
  [ [>] ['less than' puts]
    [<] ['greater than' puts]
    [=] ['is equal' puts]
  ] when].

|2 3 compare
 greater than
|3 2 compare
 less than
|2 2 compare
 is equal


void main(){
    int	a;
    int	b;

    stdout.printf("Please type in int 1\n");
    a = int.parse(stdin.read_line());

    stdout.printf("Please type in int 2\n");
    b =	int.parse(stdin.read_line());

    if (a < b)
        stdout.printf("%d is less than %d\n", a, b);
    if (a == b)
        stdout.printf("%d is equal to %d\n", a,	b);
    if (a > b)
        stdout.printf("%d is greater than %d\n", a, b);
}


Public Sub integer_comparison()
    first_integer = CInt(InputBox("Give me an integer."))
    second_integer = CInt(InputBox("Give me another integer."))
    Debug.Print IIf(first_integer < second_integer, "first integer is smaller than second integer", "first integer is not smaller than second integer")
    Debug.Print IIf(first_integer = second_integer, "first integer is equal to second integer", "first integer is not equal to second integer")
    Debug.Print IIf(first_integer > second_integer, "first integer is bigger than second integer", "first integer is not bigger than second integer")
End Sub


option explicit

function eef( b, r1, r2 )
	if b then
		eef = r1
	else
		eef = r2
	end if
end function

dim a, b
wscript.stdout.write "First integer: "
a = cint(wscript.stdin.readline) 'force to integer

wscript.stdout.write "Second integer: "
b = cint(wscript.stdin.readline) 'force to integer

wscript.stdout.write "First integer is "
if a < b then wscript.stdout.write "less than "
if a = b then wscript.stdout.write "equal to "
if a > b then wscript.stdout.write "greater than "
wscript.echo "Second integer."

wscript.stdout.write "First integer is " & _
    eef( a < b, "less than ", _
    eef( a = b, "equal to ", _
    eef( a > b, "greater than ", vbnullstring ) ) ) & "Second integer."


Sub Main()

    Dim a = CInt(Console.ReadLine)
    Dim b = CInt(Console.ReadLine)

    'Using if statements
    If a < b Then Console.WriteLine("a is less than b")
    If a = b Then Console.WriteLine("a equals b")
    If a > b Then Console.WriteLine("a is greater than b")

    'Using Case
    Select Case a
        Case Is < b
            Console.WriteLine("a is less than b")
        Case b
            Console.WriteLine("a equals b")
        Case Is > b
            Console.WriteLine("a is greater than b")
    End Select

End Sub


a <- (read)
b <- (read)
prn (if (a < b)
          : "a is less than b"
        (a > b)
          : "a is greater than b"
        :else
          : "a equals b")


import "io" for Stdin, Stdout

System.print("Enter anything other than a number to quit at any time.\n")
while (true) {
    System.write("  First number  : ")
    Stdout.flush()
    var a = Num.fromString(Stdin.readLine())
    if (!a) break
    System.write("  Second number : ")
    Stdout.flush()
    var b = Num.fromString(Stdin.readLine())
    if (!b) break
    var s = (a-b).sign
    if (s < 0) {
        System.print("  %(a) < %(b)")
    } else if (s == 0) {
        System.print("  %(a) == %(b)")
    } else {
        System.print("  %(a) > %(b)")
    }
    System.print()
}


(DEFUN COMPARE-INTEGERS ()
    (DISPLAY "Enter two integers separated by a space.")
    (NEWLINE)
    (DISPLAY "> ")
    (DEFINE A (READ))
    (DEFINE B (READ))
    (COND
        ((> A B) (DISPLAY "The first number is larger."))
        ((= A B) (DISPLAY "They are equal."))
        ((< A B) (DISPLAY "The first number is smaller."))))


code IntIn=10, Text=12;
int A, B;
[A:= IntIn(0);
 B:= IntIn(0);
if A<B then Text(0, "A<B");
if A=B then Text(0, "A=B");
if A>B then Text(0, "A>B");
CrLf(0);
]


<xsl:template name="compare">
  <xsl:param name="a" select="1"/>
  <xsl:param name="b" select="2"/>
  <fo:block>
  <xsl:choose>
    <xsl:when test="$a < $b">a < b</xsl:when>
    <xsl:when test="$a > $b">a > b</xsl:when>
    <xsl:when test="$a = $b">a = b</xsl:when>
  </xsl:choose>
  </fo:block>
 </xsl:template>


var x,y; x,y=ask("Two ints: ").split(" ").apply("toInt")
(if (x==y) "equal" else if (x<y) "less" else if(x>y) "greater").println()


10 INPUT "Enter two integers: ";a;" ";b
20 PRINT a;" is ";("less than " AND (a<b));("equal to " AND (a=b));("greather than " AND (a>b));b