LARGER2.sml

  Download

More scripts: SML Fundamentals

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# larger2.sml
# Example of a user-defined function with local variable
numeric a, b, c, d, x;
func larger ( numeric x, numeric y ) {
	local numeric d = 100;
	if (x > y) return x;
		else return y;
	}
clear();
a = 6; b = 7; d = 2;
c = larger(a,b);
printf("c= %d, d= %d, x= %d",c,d,x);