> 'Write a program that asks the user to type 10 integers and write the number of occurrence of integers less than 10

'Write a program that asks the user to type 10 integers and write the number of occurrence of integers less than 10

Posted at: 2014-12-18 
'Write a program that asks the user to type 10 integers and write the number of occurrence of integers less than 10 using do..while loop.'

import java.util.Scanner;

public class Example {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int total=0;

int i=0;

int x=0;

do {

System.out.print("Enter Integer: ");

i = sc.nextInt();

if(i<10){

total = total +1;

}

x = x + 1;

} while (x < 10);

System.out.println("Total: " + total);

}

}