Skip to content
Advertisement

Printing numeric rhombus doesn’t work properly

My rhombus is supposed to print numeric values in a pattern. It works when the input is seven, but when I tried reprogramming it to go in a loop, that is for any given number, it just outputs 1. Please help. Any criticism would be helpful. Here is my code for when it works for 7.

JavaScript

Here is my code for when it just prints one for any given value.

JavaScript

Advertisement

Answer

JavaScript

Hope you get it!!

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement