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