DoWhileLoop
package com.company;
import java.util.Scanner;
public class CWH_22_DoWhileLoop {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int a=1;
System.out.println("Enter the value of n");
int n=sc.nextInt();
do{
System.out.println(a);
a++;
}while(a<=n);
}
}
Comments
Post a Comment