java - User input calculation -


i have task create calculation based on users puts in:

    scanner reader = new scanner(system.in);     int num = 0;     system.out.print("write number: ");     int k = reader.nextint(); 

the purpose if user keys in 5 should print out of if select 5 should print out: 5 6 7 8 9 10 11 12 13 14

and can't figure out how that.

i did import import java.util.scanner;

am not sure questions though.

add piece code below, if need print ever user inputs, 14

for(int = k; <= 14 ; i++) {      system.out.print(i); } 

hope helps


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -