※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  > | 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 9   

  1. ..clause 1..: Basic knowledge
  2. ..clause 2..: Program readout
  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 commonly called the variable used to count the frequency of the repetition by the for sentence?

[  1-2  ]
What is commonly called the for sentence that continues repeating through all eternity?
Example solution

It returns to contents.


[2] Program readout


[  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 i,price;  
	
	scanf("%d",&price);  
	
	for (i = 1;i <= 9;i++) { printf("%d Price Down = %d\n",i,(int)(price * ((10.0 - i) / 10))); 
	}

	return 0;
}
Example solution

It returns to contents.


Memo


[  3-1  ]
Make the program that displays the table of multiplication 99 by using the for sentence.
The hint: When %2d finger fixed child is handled, the table is arranged.
The hint: You may use the for sentence in the for sentence.
Example solution

It returns to contents.


[4] Description type


[  4-1  ]
Describe the mechanism of the time of the constant loop of the for sentence concisely.
Example solution

It returns to contents.


[5] Basic knowledge(example solution)


[  1-1  ]
Count variable Or loop variable

[  1-2  ]
Infinite loop
Problem

It returns to contents.


[6] Program readout(example solution)


[  2-1  ]
Program that displays price of 1-9 discounts when fixed price is input.
- 10.0 It is divided by ten with - i for the discount rate and the discount rate for the calculation is requested.
Problem

It returns to contents.


Memo(example solution)


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

int main(void)  
{
	int x,y;  
	
	for (x = 1;x <= 9;x++) { 
		for (y = 1;y <= 9;y++) { 
		printf(" %2d ", x * y); 
		}
		printf("\n");  
	}
	
	return 0;
}
- 1To change line in each line Printf("\n");[Wo] is used.
- Other sentences to say nothing of the for sentence also : as long as the memory of the computer permits.
  You may make to piles how many and use it.
Problem

It returns to contents.


[8] Description type(example solution)


[  4-1  ]
Put one in the variable, and, every time, expand the one variable in the beginning.
In the finish of the loop when it grows than the frequency as the value of the variable repeats,
The loop of times of the constant has been achieved.
Problem

It returns to contents.


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