프로그래밍 언어 활용난도 중상
11번 · 주관식 · 5점
다음 C 프로그램의 실행 결과를 쓰시오.
#include <stdio.h>
typedef struct {
int balance;
double savings;
} Account;
void withdraw(Account *a, int amount) { a->balance -= amount; }
void add_interest(Account *a, double rate) { a->savings *= (1.0 + rate); }
int main(void) {
Account a = {10000, 2713.69};
withdraw(&a, 19);
add_interest(&a, 0.03);
printf("%d and %.2f", a.balance, a.savings);
return 0;
}