【发布时间】:2020-08-18 00:26:19
【问题描述】:
我想编写一个程序来检查并打印出数字是奇数还是偶数。
这就是我到目前为止所编程的:
import java.util.Scanner;
public class Irs_Lab
{
public static void main(String[] args)
{
Scanner kb = new Scanner(System.in);
System.out.print("Enter an integer :: ");
int num = kb.nextInt();
}
}
我听说您可以使用 A % (mod) 来获得除法的余数。
谁能帮我解决这个问题。
【问题讨论】: