fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Scanner;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. int n1,n2,temp,flag;
  15. Scanner sc=new Scanner(System.in);
  16. n1=sc.nextInt();
  17. n2=sc.nextInt();
  18. if(n1>n2)
  19. {
  20. temp=n1;
  21. n1=n2;
  22. n2=temp;
  23. }
  24. System.out.println("prime b"+n1" "+n2");
  25. while(n1<n2)
  26. {
  27. flag=0;
  28. for(i=2;i<n1%2;i++)
  29. {
  30. if(n1%1==0)
  31. {
  32.  
  33. flag==1;
  34. break;
  35. }
  36. }
  37. if(flag==0)
  38. {
  39. System.out.println(n1);
  40. n1++;
  41. }
  42.  
  43. }
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:24: error: ')' expected
	    System.out.println("prime b"+n1" "+n2");
	                                   ^
Main.java:24: error: unclosed string literal
	    System.out.println("prime b"+n1" "+n2");
	                                         ^
Main.java:24: error: not a statement
	    System.out.println("prime b"+n1" "+n2");
	                                      ^
Main.java:33: error: not a statement
	    		flag==1;
	    		    ^
Main.java:44: error: reached end of file while parsing
}
 ^
5 errors
stdout
Standard output is empty