this a program that work based on a specific algorithm. it works perfectly in java but whenever I run the html code i dont get error but it show me only the first three number while in java code the for loop continues until to show the whole numbers
Java code
package test1;
public class Test1
{
public static void main(String arg[])
{
int num = 1;
counterA(num);
}
public static void counterA(int num)
{
for (int i = num; i <= 24; i += 5)
{
System.out.println(i);
counterB(i);
}
}
public static void counterB(int i)
{
counterA(i * 3);
}
}
HTML code
<script>
var num1 ;
counterA(num1);
var total=0;
var counterA=function(num11)
{
for (num1 = num11; num1 <= 24; num1 += 5)
{
console.log(num1);
counterB(num1);
}
}
var counterB =function (num11)
{
counterA(num11 * 3);
}
</script>
<body>
<button onclick="counterA(1)">Try it</button>
</body>
</html>