== Write a program that reads a four digit integer and prints the sum of its digits as an output. ==
//////////////////////////////
// C Programming Homework 1 //
//////////////////////////////
// Student ID : 20114924 //
//////////////////////////////
#define fdn four_digit_num
// printf("The sum of four numbers : %d\n", (fdn/1000%10) + (fdn/100%10) + (fdn/10%10) + (fdn%10));
printf("The sum of four numbers : %d\n", (int)(fdn/1000) + (fdn/100%10) + (fdn/10%10) + (fdn%10));
== Write a C program that output as follows. ==
//////////////////////////////
// C Programming Homework 1 //
//////////////////////////////
// Student ID : 20114924 //
//////////////////////////////
for(j=0; j<(i*2+1); j++) {
== Write a program that gets a starting principal(A, 원금), annual interest rate(r, 연이율) from a keyboard (standard input) and print the total amount on deposit (예치기간이 지난 뒤 총금액, 원리합계) for the year(n) from 0 to 10. ==
total deposit = A*(1+r)^n
1000.0 0.05 <- keyboard input // 5% should be written as 0.05
//////////////////////////////
// C Programming Homework 1 //
//////////////////////////////
// Student ID : 20114924 //
//////////////////////////////
printf("%5d %12.2f\n", i, a);
}}}
삭제해주세요