help me w this code pls .... please teach me a lil about scanner code input | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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.

12th Dec 2020, 12:13 AM
elsa
2 Respostas
+ 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
12th Dec 2020, 1:23 AM
Piyush
Piyush - avatar
0
thank you
12th Dec 2020, 2:07 AM
elsa