User input numbers not adding together

后端 未结 3 1422
轻奢々
轻奢々 2021-01-27 02:46

I\'m trying to write a program that reads an integer from the user (through the keyboard), adds 100 to it and displays the result. All I can do is get them to concatenate like 2

3条回答
  •  没有蜡笔的小新
    2021-01-27 03:08

    You are adding the wrong variable. Use this instead:

    System.out.println(" Your value + 100 is " + ( 100 + number));
    

提交回复
热议问题