TABLAS DE MULTIPLICAR DEL UNO AL DIEZ

mult(N):-mult(N,1). mult(N,A):-A>N,!. mult(N,A):-mult(N,A,1),A1 is A+1,mult(N,A1). mult(N,_,B):-B>N,!. mult(N,A,B):-write(A),write('*'),write(B),write('='),write(---->),Z is A*B,write(Z),nl,B1 is B+1,mult(N,A,B1).
NOTA:
El write lo pueden sustituir por la palabra display ya que técnicamente hace lo mismo.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.