online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; int main() { int n=0, i=2; bool isPrime=true; cout<<"Enter the integer:"; cin>>n; if (n==0 || n==1) { isPrime=false; } else { for (i=2; i<=n/2; ++i) { if (n%i==0) { isPrime=false; break; } } } if (isPrime) { cout<<"Your integer is a prime number"<<n<<endl; } else { cout<<"Your integer is not a prime number"<<n<<endl; } return 0; } // end of main.

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue