Practice Problem 5
Basics
Question 1-1
What do you call naming the memory where numbers are stored?
Question 1-2
What do you call storing numbers in a specific location?
Question 1-3
What do you call increasing the numbers at the aforementioned location by one?
Program reading
How will the program be displayed when executed?
Question 2-1
#include <stdio.h>
int main(void)
{
int x, y;
x = 10;
y = x * 10 + 20;
printf("%5d\n", y);
return 0;
}
Program Manual
Question 3-1
Purchase one bottle of soft drink priced at ¥198 and two bottles of milk priced at ¥138 each. Calculate the change when paying with a ¥1,000 bill. Add a 5% consumption tax and round the change amount to the nearest whole yen. You may choose whether to round the consumption tax amount.
explanatory
Question 4-1
When performing calculations with real numbers and integers, such as 3.14 * 12,The answer is to be treated as a real number, but briefly explain why.
Fundamentals (Answer Key)
Solution 1-1
Variable declaration
Variables alone are also considered correct.
Solution 1-2
Assignment
Solution 1-3
increment
Program Reading (Solution Example)
Solution 2-1
120
Since it's a %5d format specifier, there will be a two-digit space in the preceding part.
Program Documentation (Example Solution)
Solution 3-1
#include <stdio.h>
int main(void)
{
int juice, milk, money, payment, change;
double tax;
juice = 198;
milk = 138;
money = 1000;
tax = 1.05;
payment = (int)((juice + milk * 2) * tax);
change = money - payment;
printf("%dCircle\n", change);
return 0;
}
Solution 2-1
503 yen
You can solve it without variables, but using them will make changes easier later.
Points will be deducted if you forget to cast.
Answers given as real numbers will also be penalized.
Depending on the calculation method, the answer may vary slightly.
Descriptive (answer example)
Solution 4-1
To prevent decimal numbers from being truncated.
About This Site
Learning C language through suffering (Kushi C) isThis is the definitive introduction to the C language.
It systematically explains the basic functions of the C language.
The quality is equal to or higher than commercially available books.




