Computer Science, asked by vahesargsyan387, 8 months ago

Write a program in Java Script which prints the numbers from 1 to N (N is given and print a space after each number). For numbers which are multiples of four print "Happy" and for the multiples of five print "Holidays" instead of the number, for numbers which are multiples of both four and five print "HappyHolidays".
For example if the interval is 1 to 20 then I should get
1 2 3 Happy Holidays 6 7 Happy 9 Holidays 11 Happy 13
14 Holidays Happy 17 18 19 HappyHolidays
I should write this code by using loops and if else.. I have only covered loops until now.
Pleases can you help me

Answers

Answered by somnathgoswami2247
0

for var in range(1,N+1):

print(var,end=" ")

Similar questions