//https://csprograms4u.blogspot.com/
//Chapter 2
//Program 10
//Use of do while loop in Java
import
java.util.Scanner;
public
class doWhileLoop
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter any
number");
int n=sc.nextInt();
int i=1;
do
{
System.out.print(" "+i);
i++;
}while(i<=n);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.