Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let num1 = Number(input[0]);
- let num2 = Number(input[1]);
- let sum = 0;
- let sum2 = 0;
- for (let i = num1; i <= num2; i++) {
- if (i === num2) {
- console.log(`The sum: ${sum}`);
- }
- if (i % 9 === 0) {
- sum += i;
- console.log(i);
- }
- }
- }
- solve([
- '100',
- '200'
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement