fork download
  1. /*
  2.  * File: main.cpp
  3.  * Author: mg909
  4.  *
  5.  * Created on July 30, 2015, 10:59 AM
  6.  */
  7.  
  8. #include <cstdlib>
  9. #include <iostream>
  10.  
  11.  
  12. int main()
  13. {
  14. int i,n,d;
  15.  
  16. cout<<"Enter the number/n";
  17. cin>>n;
  18. int Prime(int n)
  19. { if(n==2);
  20. { cout<<"Number is Prime";
  21. }
  22. }
  23. for(i==2;i<n-1;i++)
  24. { if(n/i==d)
  25. { cout<<"Number is not Prime";
  26. }
  27. else
  28. { cout<<"Number is prime"
  29. }
  30.  
  31.  
  32.  
  33. return 0;
  34.  
  35.  
  36. }
  37.  
  38.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:16:9: error: 'cout' was not declared in this scope
         cout<<"Enter the number/n";
         ^
prog.cpp:16:9: note: suggested alternative:
In file included from prog.cpp:9:0:
/usr/include/c++/5/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
prog.cpp:17:9: error: 'cin' was not declared in this scope
         cin>>n;
         ^
prog.cpp:17:9: note: suggested alternative:
In file included from prog.cpp:9:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
prog.cpp:19:17: error: a function-definition is not allowed here before '{' token
                 {       if(n==2);
                 ^
prog.cpp:36:1: error: expected '}' at end of input
 }
 ^
stdout
Standard output is empty