You are viewing a single comment's thread. Return to all comments →
I think for loop is troubling everyone here (including me ). For loop limit should be the first int we are taking . Its just not any random number, its actually the number of inputs which different test cases gonna have.
I really appreciated, you save my life and time. just I added one missing part you should delet = in side for loop.
once the exception is caught it isn't going back to the try block for next input. help please...
public static void main(String argh)
Scanner sc = new Scanner(System.in);
System.out.println(x+" can be fitted in:");
if(x>=-128 && x<=127)System.out.println("* byte");
//Complete the code
System.out.println(sc.next()+" can't be fitted anywhere.");
ths is my code it work no any error. good luck