online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// LAB_7-2.c #pragma warning(disable:4996) #include <stdio.h> // printf, scanf #include <math.h> // sqrt // num이 소수이면 1, 아니면 0 반환 int isPrime(int num) { if (num <= 1) return 0; // 1 이하면 소수 아님 for (int i = 2; i <= (int)sqrt(num); i++) { if (num % i == 0) return 0; // 나누어 떨어지면 소수 아님 } return 1; // 위 반복 통과하면 소수 } int main(void) { 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