online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// example7-1.c #pragma warning(disable:4996) #include <stdio.h> // printf, scanf #include <stdlib.h> // rand, srand #include <time.h> // time // 1~6 μ‚¬μ΄μ˜ λ‚œμˆ˜ λ°˜ν™˜ int throwDice(void) { return rand() % 6 + 1; } // μ‚¬μš©μžλ‘œλΆ€ν„° 0~6 μ‚¬μ΄μ˜ μ •μˆ˜λ₯Ό μž…λ ₯λ°›μ•„ λ°˜ν™˜ // 0을 μž…λ ₯ν•˜λ©΄ κ²Œμž„ μ’…λ£Œ int getUserGuess(void) { int guess; printf("μ£Όμ‚¬μœ„λ₯Ό 던져 λ‚˜μ˜¬ 숫자λ₯Ό λ§žν˜€λ³΄μ„Έμš” (1~6, μ’…λ£ŒλŠ” 0): "); scanf("%d", &guess); return guess; } // κ²Œμž„ 둜직 void playGuessingGame(void) { int userGuess, diceResult; do { userGuess = getUserGuess(); if (userGuess == 0) { // 0 μž…λ ₯ μ‹œ 반볡 μ’…λ£Œ break; } diceResult = throwDice(); printf("μ£Όμ‚¬μœ„ κ²°κ³Ό: %d\n", diceResult); if (userGuess == diceResult) { printf("μΆ•ν•˜ν•©λ‹ˆλ‹€! 숫자λ₯Ό λ§žν˜”μŠ΅λ‹ˆλ‹€.\n\n"); } else { printf("μ•„μ‰½μŠ΅λ‹ˆλ‹€. λ‹€μ‹œ μ‹œλ„ν•˜μ„Έμš”.\n\n"); } } while (userGuess != 0); } int main(void) { // λ‚œμˆ˜ μ΄ˆκΈ°ν™” srand((unsigned)time(NULL)); printf("===== μ£Όμ‚¬μœ„ 숫자 맞히기 κ²Œμž„μ„ μ‹œμž‘ν•©λ‹ˆλ‹€ =====\n\n"); playGuessingGame(); printf("===== κ²Œμž„ μ’…λ£Œ =====\n"); 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