online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#pragma warning(disable:4996) #include <stdio.h> #include <math.h> // μˆ˜ν•™ ν•¨μˆ˜λ₯Ό μ œκ³΅ν•˜λŠ” 헀더 파일 int isPrime(int num); // μ†Œμˆ˜λ₯Ό νŒλ³„ν•˜λŠ” μ‚¬μš©μž μ •μ˜ ν•¨μˆ˜ μ„ μ–Έ int isPrime(int num){ if (num <= 1) return 0; // num이 1 보닀 μž‘κ±°λ‚˜ κ°™μœΌλ©΄ 0을 λ°˜ν™˜ for (int i = 2; i <= sqrt(num); ++i){ // 2λΆ€ν„° μž…λ ₯된 μ •μˆ˜μ˜ μ œκ³±κ·ΌκΉŒμ§€ 반볡 μˆ˜ν–‰ 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