Given an int variable k that has already been declared, use a do…while loop to print a single line consisting of 53 asterisks. Use no variables other than k.

Given an int variable k that has already been declared, use a do…while loop to print a single line consisting of 53 asterisks. Use no variables other than k.

LANGUAGE: JAVA

CHALLENGE:

Given an int variable k that has already been declared, use a do…while loop to print a single line consisting of 53 asterisks. Use no variables other than k.

SOLUTION:

k = 0;
do{
   System.out.print("*");
   k++;
}while (k < 53);

Add comment