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
0
for var in range(1,N+1):
print(var,end=" ")
Similar questions
English,
4 months ago
Social Sciences,
4 months ago
Science,
8 months ago
India Languages,
1 year ago
English,
1 year ago