- ..clause 1..: Basic knowledge
- ..clause 2..: Program readout
- Memo
- ..clause 4..: Description type
- ..clause 5..: Basic knowledge(example solution)
- ..clause 6..: Program readout(example solution)
- Memo(example solution)
- ..clause 8..: Description type(example solution)
[ 1-1 ]
What is the option that adds the sentence executed when the condition is an imitation to the if sentence?
[ 1-2 ]
What is commonly called writing that combines the above-mentioned many sentences and uses it?
Example solution
[ 1-3 ]
What is the sentence used to divide the sentence processed according to the number?
Example solution
[ 2-1 ]
For what display is the following program a program?
Judging from the content of processing and the variable identifier, answer.
#include <stdio.h> int main(void) { int year; scanf("%d",&year); if (year % 2 == 0) { if (year % 4 == 0) { printf("summer\ n"); } else { printf("winter\n"); } } else { printf("do not\n"); } return 0; }
Example solution
[ 3-1 ]
Make the program that displays the moon of the corresponding lunar calendar when you input the moon.
Display the message of something when you input the moon that doesn't exist.
The hint: Lunar calendar sequentially : in January.
January and February, Yayoi, and April, May, June, July, August, September, October, November, and December
Example solution
[ 4-1 ]
Why is the break sentence put after each case sentence in the switch sentence?
Moreover, describe concisely when it is at that this is unnecessary.
[ 1-1 ]
Else sentence
[ 1-2 ]
Else-if sentence
Problem
[ 1-3 ]
Switch sentence
You may write the switch-case sentence.
Problem
[ 2-1 ]
Display whether for the Olympics to be held when the age is input at the Christian era.
- The last problem was only rewritten by the if-else sentence.
Problem
[ 3-1 ]
- It is acceptable, and the switch sentence is suitable for the if sentence when a lot of diverging.#include <stdio.h> int main(void) { int month; printf(..".. input the moon. "); scanf("%d",&month); switch (month) { case 1: Printf ("January \n"); break; case 2: Printf ("February \n"); break; case 3: Printf ("Yayoi \n"); break; case 4: Printf ("April \n"); break; case 5: Printf ("\n in May"); break; case 6: Printf ("June \n"); break; case 7: Printf ("\n in July"); break; case 8: Printf ("August \n"); break; case 9: Printf ("Length moon \n"); break; case 10: Printf ("God no moon \n"); break; case 11: Printf ("November \n"); break; case 12: Printf ("December \n"); break; default: printf(There is no such moon .."... \n"); break; } return 0; }
- When the default sentence is lacked, it is assumed that it gives a demerit mark.
Problem
[ 4-1 ]
The switch sentence : only of the jump to the case sentence to the end because it can do nothing but function.
It is necessary to slip out the entire ending switch sentence of each case sentence putting the break sentence.
However, you may tie as it is when there is a common feature in the processing of each case sentence.