User:Myselfashok

import java.util.Scanner;

public class Print1toN { public static void main(String[] args){ Scanner sc= new Scanner (System.in); System.out.println("Enter a number for printing"); int number=sc.nextInt; for(int i=1;i<=number;i++){ System.out.print(i+" "); } } }