online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; bool esprimo(int); bool sonprimosgemelos(int, int); const int maxnum=100; int main() { for (int k=3; k<maxnum-1; k++){ if (sonprimosgemelos(k, k+2)){ cout<<k<<" y "<<k+2<<" son primos gemelos"<<endl; } } return 0; } bool esprimo(int num){ if(num==2 || num==3) return true; for (int i=3; i<num/2; i++){ if(num%i == 0){ return false; } } return true; } bool sonprimosgemelos(int a, int b){ if(esprimo(a) && esprimo(b)){ if((a-b)==2) return true; }else{ return false; } }

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