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){ if (num % i == 0) return 0; // 2λΆ€ν„° μž…λ ₯된 μ •μˆ˜μ˜ μ œκ³±κ·ΌκΉŒμ§€ 반볡 μˆ˜ν–‰ } return 1; // μœ„ 쑰건을 λͺ¨λ‘ ν†΅κ³Όν•˜λ©΄ μ†Œμˆ˜μ΄λ―€λ‘œ 1 λ°˜ν™˜ } int main(){ // ν”„λ‘œκ·Έλž¨ μ‹œμž‘, main ν•¨μˆ˜ μ •μ˜ int num; // μž…λ ₯받을 μ •μˆ˜λ₯Ό μ €μž₯ν•  λ³€μˆ˜ μ„ μ–Έ // isPrime() ν•¨μˆ˜μ˜ λ§€κ°œλ³€μˆ˜λ‘œ, ν•¨μˆ˜ λ‚΄λΆ€μ—μ„œ μ‚¬μš©λ˜λŠ” μ§€μ—­ λ³€μˆ˜ 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