LoginSignup
1
0

More than 1 year has passed since last update.

【Java基礎】割り算の余りを求める

Last updated at Posted at 2023-01-29

[問題]  (参照:http://www.cc.kyoto-su.ac.jp/~mmina/bp1/hundredKnocksBasic.html)
15000を7で割った余りを表示するプログラムを作成しなさい。

コード

public class Main {
    public static void main(String[] args) throws Exception {
        System.out.println(15000 % 7);
    }
}

結果

6

★ a % b =aをbで割った余り

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0