Skip to content
Advertisement

JavaScript not printing out values

So I’m trying to print all values of x,y,z from this equation x − 2y + 3z = 0 (value of between 1-5, the value of y is between 6-10, and z is between 3-7) on HTML through javascript but the

JavaScript

Only displays the maximum value of x, y, z. instead of any possible solution. So I’m unsure whether there is a problem with the for loops and the way I’m trying to display on the HTML page. This is the output I want

JavaScript
JavaScript

Advertisement

Answer

You can try following code to print the solutions for the equation:

html:

JavaScript

javascript :

JavaScript

PS: You can apply style however you want.

Advertisement