0

What is wrong with my code....plz help me

i have created a calculator....but it is npt working..help me.. https://code.sololearn.com/cIYG1mbUpk33/?ref=app

6th Aug 2017, 4:07 AM
Shobh
Shobh - avatar
3 RĂ©ponses
+ 7
".nextInt() gets the next int, but doesn't read the new line character. This means that when you ask it to read the "next line", you read til the end of the new line character from the first time." So this was what I did: int a = s.nextInt(); int b = s.nextInt(); s.nextLine(); String c = s.nextLine(); input: 1 2 add Output: 3
6th Aug 2017, 4:18 AM
Hatsy Rei
Hatsy Rei - avatar
+ 3
input: 2 3 subtract debug: System.out.println(a); System.out.println(b); System.out.println(c); output: 2 3 subtract // space at start
6th Aug 2017, 4:15 AM
Kirk Schafer
Kirk Schafer - avatar
6th Aug 2017, 4:38 AM
Mayur Chaudhari
Mayur Chaudhari - avatar