Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
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 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
0
thank you