Computer Science, asked by anupamlugun04, 3 months ago

Write algorithm to print HELLO WORLD message ten times on the
screen.

Answers

Answered by totakuraveerabhadrao
2

Answer:

plz mark me brainliest

Explanation:

print("Hello World\n"*10) 

Here the “\n” is just a new-line character, so you get 10 lines instead of 1 long line.

Or you could use a simple loop:

foriinrange(10):print("HelloWorld")foriinrange(10):print("HelloWorld")

(Here the line breaks are automatic.)

In SWI Prolog:

ten_times() :- my_loop("Hello World", 10). 

 

my_loop(_, 0). 

my_loop(X, N) :- 

Nmin is N-1, 

print(X), 

my_loop(X, Nmin). 

Similar questions