fork(10) download
  1. import java.util.* ;
  2.  
  3. class Platinum
  4. {
  5.  
  6. public static void main(String args[ ])
  7. {
  8.  
  9. int m ; // m is no. of blocks of platinum
  10. Scanner ob=new Scanner(System.in);
  11.  
  12.  
  13. System.out.println("enter the no of blocks of platinum you want to exchange between 2 and 1000,000,000 included:");
  14.  
  15. m=ob.nextInt();
  16. if(m<2 || m>1000000000 )
  17. {
  18. System.out.println("You have entered a number out of the range
  19.  
  20. specified! ");
  21. System.out.println("Please Enter number between 1 and 1000000000
  22.  
  23. included:");
  24. }
  25.  
  26.  
  27. else if(m==2)
  28.  
  29. { System.out.println("you can exchange "+m +" blocks of platinum for "+ m +" units of currency");
  30. System.exit(0);
  31. }
  32.  
  33. else
  34.  
  35. {
  36. System.out.println("no of blocks of platinum you want to exchange:"+m);
  37.  
  38. }
  39. int a=m/2;
  40. int b=m/3;
  41. int c=m/4;
  42. int d=a+b+c;
  43.  
  44. System.out.println("you can exchange "+m +" blocks of platinum for "+ d +" units of currency");
  45.  
  46. }
  47.  
  48. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:18: error: unclosed string literal
   System.out.println("You have entered a number out of the range    
                      ^
Main.java:18: error: ';' expected
   System.out.println("You have entered a number out of the range    
                                                                     ^
Main.java:20: error: unclosed string literal
specified! ");
           ^
Main.java:20: error: not a statement
specified! ");
         ^
Main.java:21: error: unclosed string literal
   System.out.println("Please Enter number between 1 and 1000000000 
                      ^
Main.java:21: error: ';' expected
   System.out.println("Please Enter number between 1 and 1000000000 
                                                                    ^
Main.java:23: error: illegal start of expression
included:");
        ^
Main.java:23: error: unclosed string literal
included:");
         ^
8 errors
stdout
Standard output is empty