online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cmath> using namespace std; // μ›κΈˆ 예치 ν›„ 볡리이율 적용 long calcCompoundInterest(long money, long month, double rate) { double result = money * pow((1 + rate/12), month); return (long)result; } // λ§€μ›” λ™μΌν•œ λ‚©μž… κΈˆμ•‘, 단기 이율 적용 long calcSimpleInterest(long money, long month, double rate) { double result = money * month + money * month * (month + 1) / 2 * (rate / 12); return long(result); } int main() { double rate = 0.02; // λ§€μ›” 10만 원씩 24κ°œμ›” λ™μ•ˆ μ κΈˆμ„ λ„£μŒ cout << "단리 :" << calcSimpleInterest(100000, 24, rate) << endl; // 240만 원을 ν•œ λ²ˆμ— 예금 톡μž₯에 넣어두고 24κ°œμ›” λ™μ•ˆ κΈ°λ‹€λ¦Ό cout << "볡리 :" << calcCompoundInterest(2400000, 24, rate) << endl; 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