※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
> | advanced by | contents  | that returns in <
< [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard

Exercise 10

1. ..clause 1..: Basic knowledge
3. Memo
4. ..clause 4..: Description type
5. ..clause 5..: Basic knowledge(example solution)
6. ..clause 6..: Program readout(example solution)
7. Memo(example solution)
8. ..clause 8..: Description type(example solution)

[1] Basic knowledge

[  1-1  ]
What is called the repetition to which the condition is previously judged like the while sentence?

[  1-2  ]
What is called the repetition from which the condition is judged back like the do-while sentence?
Example solution

It returns to contents.

[  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 = 0;
double money = 10000;

while (money < 15000) {
year++;
money *= 1.01;
}

printf("%d , %f\n",year , money);

return 0;
}
```
Example solution

It returns to contents.

Memo

[  3-1  ]
I want to make the program that inputs the point of the test.
However, because there is a point of the test only up to 0-100
Input it again when the rest is input.
Example solution

It returns to contents.

[4] Description type

[  4-1  ]
Explain why it to be suitable for the input check in the do-while sentence concisely.
Example solution

It returns to contents.

[5] Basic knowledge(example solution)

[  1-1  ]

[  1-2  ]
Post-judgment
Problem

It returns to contents.

[  2-1  ]
When you entrust 10000 yen to the bank of 1% an interest rate year
Program that displays how many years to take for it to become 15000 yen.
Problem

It returns to contents.

Memo(example solution)

[  3-1  ]
```
#include <stdio.h>

int main(void)
{

int score;

Point..input.
scanf("%d",&score);
} while (score < 0 || score > 100);

Printf ("Input point several %d\n" score);

return 0;
}
```
Do as follows when you want to make the message displayed at the re-input.
It is distinguished whether there are 0 in variable score and it is the first input.
When 0 is input to score, the condition doesn't put it on because it comes off the loop.
```
#include <stdio.h>

int main(void)
{

int score = 0;

"The point :   If (Score =   0) ..printf (.. input it within the range of 0-100. \n");  Printf ("Input the point");
scanf("%d",&score);
} while (score < 0 || score > 100);

Printf ("Input point several %d\n" score);

return 0;
}
```
Problem

It returns to contents.

[8] Description type(example solution)

[  4-1  ]
Because the do-while sentence is a post-judgment loop, it is executed once without fail in the beginning.
Because the situation of not inputting it doesn't happen.
Problem

It returns to contents.

< - It is advanced -> | in | head that returns  to returning  next |.