In this HackerRank Java Loops I problem we have given an integer and need to print its first 10 multiples using the for a loop.

HackerRank Java Loops I problem solution

HackerRank Java Loops I problem solution

 
class whileLoopDemo
{
    public static void main(String args[])
    {
        int i = 1;
 
        // Exit when i becomes greater than 10
        while (i <= 10)
        {
        	
            //print i on new line every time
            System.out.println(i);
 			
            //increment i every time
            i++;
        }
    }
}