0
help me w this code pls .... please teach me a lil about scanner code input
You can win prizes by playing the lottery. If the ticket number is a multiple of 10 and 9, the program outputs âYou won $200â. If it is a multiple of 4 or 6, the program outputs âYou won $50â. In all other cases, there is no prize and the output is âTry againâ. Sample Input 11457 Sample Output Try again Hint Number a is a multiple of number b, if a%b == 0.
2 Answers
+ 2
On the top of your code import util package like this đ as scanner class is in util package
import java.util.*;
Then in your code create an object for scanner class đ
Scanner sc=new Scanner (System.in);
Then for your input
int n=sc.nextInt();
âïž This will take the input
I hope your doubt will clear now
0
thank you