0

what's wrong in this code??

Many tall buildings, including hotels, skip the number 13 when numbering floors -- often going from floor 12 to floor 14. It is thought that the number 13 is unlucky. Write a program that will number 15 rooms starting from 1, skipping the number 13. Output to the console each room number in separate line. var countOfRooms = 15; // Your code here for (countOfRooms = 0; countOfRooms <= 15; countOfRooms++ ) { if (countOfRooms ==13) { continue; } console.log(countOfRooms + 0); }

17th Feb 2021, 12:42 PM
NIKHIL SONAWANE
NIKHIL SONAWANE - avatar
10 Respostas
+ 7
NIKHIL SONAWANE var countOfRooms = 15; // Your code here for (i = 1; i <=countOfRooms+1; i++){ if (i == 13){ continue; } console.log(i); } do try to understand what you missed. you are almost there.
17th Feb 2021, 12:54 PM
CHANDAN ROY
CHANDAN ROY - avatar
+ 1
Starting from "1"
17th Feb 2021, 12:46 PM
Abhay
Abhay - avatar
0
Insted of "0" ??
17th Feb 2021, 12:48 PM
NIKHIL SONAWANE
NIKHIL SONAWANE - avatar
0
NIKHIL SONAWANE Well you didn't understand the question properly. It is written in the question itself to start count from 1. So, it should count from 1 to 16 as we are skipping 13.
17th Feb 2021, 12:49 PM
CHANDAN ROY
CHANDAN ROY - avatar
0
CHANDAN ROY correct me if am wrong So var countOfRooms 16 and countOfRooms = 16 ??
17th Feb 2021, 12:52 PM
NIKHIL SONAWANE
NIKHIL SONAWANE - avatar
0
var countOfRooms = 16; // Your code here for (countOfRooms = 1; countOfRooms <= 16; countOfRooms++ ) { if (countOfRooms ==13) { continue; } console.log(countOfRooms + 0); } Thanks it done 😁😁
17th Feb 2021, 12:55 PM
NIKHIL SONAWANE
NIKHIL SONAWANE - avatar
0
var countOfRooms = 16; // Your code here var i=15; for (i = 1; i <= countOfRooms; i++) { if (i == 13) { continue; } console.log(i ); }
26th Jun 2021, 9:17 AM
Abiel M
Abiel M - avatar
0
var countOfRooms = 15; // Your code here var rooms = 1 for(rooms=1; rooms<=countOfRooms+1; rooms++){ if(rooms == 13){ continue } console.log(rooms) }
7th Jul 2021, 10:19 AM
snipher marube
snipher marube - avatar
0
I keep getting that i have no input driving me insane - I have: var countOfRooms = 15 //your code here var i = countOfRooms for (i=1; i <=16; i++) { if (i ==13) { continue; } console.log(i); } That wasnt copy and pasted i retyped it - even if I do it with the original variable or if assign a value to it again and ive had different variations of this and i keep getting No input -why? These are how the examples are presented and they run without issue? HELP!! 🤞
7th Oct 2021, 12:57 PM
Shannon McLarey
0
var countOfRooms = 15; // Your code here for (i = 1; i <=countOfRooms+1; i++){ if (i == 13){ continue; } console.log(i); } Good Luck
25th Jan 2022, 8:16 AM
Muhammad Alif Deva Rizqon
Muhammad Alif Deva Rizqon - avatar