+ 1
Check out this problem and help me to improve it
program is to print a no. in words. I am getting some error if I am giving the input greater than 900 crore , but that is not beyond the storing limit of integers . Output is coming for 105 crores, the error is " Input mismatch Exception" 🤔🤔🤔 please check it out. https://code.sololearn.com/c0XJxaeZbUZM/?ref=app
10 Réponses
+ 10
InputMismatchException occurs when the program doesn't get the expected type of input. int data type can hold upto a specific range.
Print out the value of Integer.MAX_VALUE and INTEGER.MIN_VALUE to know the range. If the user input exceeds this range, it can't be assigned as an int variable. For too large numbers, consider looking into BigInteger class, or treat the number as a String.
+ 18
https://code.sololearn.com/chT7ny6A83MJ/?ref=app
//as suggested by yasmin
//214 crores (approx) ... integer type can hold
+ 16
its gaurav , ! (!gaurab) @yasmin ,
//ppl will never write my name correctely ... nothin can be done
// (name.equals ("Gaurav")||name.equals ("gaurav")) must return true
+ 15
// a good code for that ... see this ☺
//-By Gawen
https://code.sololearn.com/c4Wpkowl2m87/?ref=app
+ 15
i think u should say thanks to yasmin , as she telled u to how remove those errors & check when errors like this occur ☺
//& its Gaurav , !Gaurab
+ 14
a correction wait , i mean ! ("!Gaurab")
//bcz u were saying me !Gaurab initially 😃😂 , when say Gaurav , then "Gaurav" & when !Gaurab , then "!Gaurab"
//yeah , it was just a typo error
//btw i have a challenge link for u
https://www.sololearn.com/Discuss/951797/?ref=app
+ 10
@ !Gaurab, not a big deal. But thanks for your courtesy ^_^
@Rahul, glad it helped :)
+ 9
@ !Gaurab, I know your name but since Gaurab is false, !Gaurab is true. And FYI, !(!Gaurab) is equivalent to Gaurab :D
+ 1
@Yasmin ,thanks for the explanation
0
@ Gaurav ,both codes do the same work and Thanks for clearing my doubt