online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <math.h> int isPrime(int num); int isPrime(int num){ if(num <= 1)return 0; for(int i=2; i<=sqrt(num);i++){ /*2부터 입력된 num의 제곱근까지 반복 수행 제곱근 함수 안쓰면 속도가 느려짐*/ if(num % i ==0)return 0; } return 1; } int main(){ int num; printf("정수를 입력하세요:"); scanf("%d",&num); if(isPrime(num)){ printf("%d는 소수입니다.\n",num); }else{ printf("%d는 소수가 아닙니다.\n",num); } return 0; }

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