Print the number series 10 100 1000 using for loop in Java
for Loop - Question 3
In this question, we will see how to print the number series 10 100 1000... in Java programming using for loop. To know more about for loop click on the for loop lesson.
Q3) Write a program in Java to print the number series given below using for loop.
10 100 1000 10000 100000
Program
public class Q3
{
public static void main(String args[])
{
int i;
for(i=10; i<=100000; i=i*10)
{
System.out.print(i + " ");
}
}
}
Output
10 100 1000 10000 100000