fork download
  1. class Prime
  2. {
  3. public static void main(String args[]){
  4. int i,n=7,flag=0;
  5. for(int i=2;i<n;i++){
  6. if(n%i==0){
  7. flag=1;
  8. break;
  9. }
  10. if(flag==0){
  11. System.out.println("prime numbers");
  12. }
  13. else{
  14. System.out.println("Composite numbers");
  15. }
  16. }
  17. }
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError:   File "prog.py", line 1
    class Prime
              ^
SyntaxError: invalid syntax

stdout
Standard output is empty