// TruthValues.kt Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2024-01-19 File created. /* This program shows how the truth values of three relational expressions change when a loop is executed. */ fun main() { var left_integer = 4 print( "\n left right < >= != \n" ) ; for ( right_integer in 0 .. 6 ) { print( "\n " + left_integer + " " + right_integer ) val first_truth_value : Boolean = ( left_integer < right_integer ) val second_truth_value : Boolean = ( left_integer >= right_integer ) val third_truth_value : Boolean = ( left_integer != right_integer ) print( " " + first_truth_value + " " + second_truth_value + " " + third_truth_value ) } print( "\n" ) } /* Here is a sample output of the program: D:\programs\kotlinfiles2>c:\freeware\kotlinc\bin\kotlinc TruthValues.kt -include-runtime -d runthis.jar D:\programs\kotlinfiles2>java -jar runthis.jar left right < >= != 4 0 false true true 4 1 false true true 4 2 false true true 4 3 false true true 4 4 false true false 4 5 true false true 4 6 true false true */