Computer Science, asked by tlrr2007, 1 month ago

print the twice of first 12 natural number ascending order using do-while-loop​

Answers

Answered by BrainlyProgrammer
1

Question:-

  • To print the twice of first 12 natural numbers using do-while

Code-Language:-

  • Not mentioned
  • Done in Java

Answer:-

package Coder;

public class Natural

{

public static void main (String ar [])

{

int I=1;

do{

System.out.println(I*2);

I++;

}while(I<=12);

}

}

Learn more about Do-while loop:-

  • Do while loop is also known as exit controlled loop as it checks the condition after execution of the statement
  • It executes the loop only one times even if the condition is false

Output Attached

Attachments:
Similar questions