Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exam(input) {
- let n = Number(input[0]);
- let m = Number(input[1]);
- let s = Number(input[2]);
- let output = ""
- for (let i = m; i >= n; i--) {
- if (i % 2 === 0 && i % 3 === 0) {
- if (i === s){
- break;
- }
- output+= i + " "
- }
- }
- console.log(output);
- }
- exam(["20",
- "1000",
- "36"])
Advertisement
Add Comment
Please, Sign In to add comment