I have tried to Increasing Number By one Like this
for (int i = 0; i < 10; i++) {
System.out.println("Count " + i);
}
this logic Works fine.
but when i try to make it As user input for the series its not giving same out put from 0
See this
Scanner scanner = new Scanner(System.in);
// System.out.println(scanner.hasNextInt());
if (scanner.hasNextInt()) {
// System.out.println(scanner.nextInt());
System.out.println(Integer.parseInt(scanner.next()));
for (int i = 0; i < Integer.parseInt(scanner.next()); i++) {
System.out.println("Count " + i);
}
}
its not giving out put by increasing element its giving if i input for example 12 Out Put:-
15
Count 0
Can any body can say why?