+ 2
I'm getting error where my output and expected output is same.
I'm into Multiple exception handling now I'm receiving error and i can't move to next stag my code and output is same as solution and expected output.
9 Respuestas
+ 2
Rewrite the phrase :
"Error: division by zero"
Then try...
+ 2
Not enough details...
In which language?
Pls show your code.. Along with trouble..
+ 2
Code is working fine..
Do you testing this in code coach?
+ 2
I actually copy pasted the exact phrase from the problem
https://prnt.sc/JcXFgt-C9rSf
+ 2
This q/a (discuss) is here for that purpose only..
Try to make best use of it if needed..
You're welcome...
+ 1
import java.util.Scanner;
import java.util.InputMismatchException;
public class Main
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
try {
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
System.out.println(num1/num2);
/*
1. Error: division by zero
2. Error: wrong value type
*/
//your code goes here
} catch(ArithmeticException e1) {
System.out.println("Еrror: division by zero");
} catch(InputMismatchException e2){
System.out.println("Error: wrong value type");
}
}
}
+ 1
Actually my problem is my code is wright but i can't move to next stage i felt like bug
My output and expected output both are same but showing error.
How to resolve this issue?
+ 1
That's what the problem. Problem description has a invisible character in the phrase. So won't matching with expected output...
just rewrite your own.. then try.. or
copy from code comments..
+ 1
Thanq bro..
I'm new here, i didn't aware of this..