Print a string N times - Artificial Intelligence Lab file



AIM: Print a string N times

domains
P=integer

predicates
times(P).

clauses
    times(0).
 
    times(P):-
             P1=P-1,
             write("Hello \n"),
             times(P1). 

Output:


No comments:

Post a Comment