Suppose that the input is:
58 23 46 75 98 150 12 176 145 -999
What is the output of the following program?
import java.util.*;
public class FindTheOutput
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
int num;
num = console.nextInt();
while (num != -999)
{
System.out.print(num % 25 + " ");
num = console.nextInt();
}
System.out.println();
}
}
8 23 21 0 23 0 12 1 20
Comments
Leave a comment