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


  Repeated sentence   

  1. ..clause 1..: It repeats and it operates.
  2. ..clause 2..: Display of frequency

[1] It repeats and it operates.

The computer repeats the same thing even times how many.
It is possible to repeat even tens of thousands of hundred million how many times and times if it is necessary.

The repetition includes an uncertain repetition of the repetition and the frequency that the frequency is decided.
In C language, use for (Fo) sentence for the repetition to which the frequency is decided.
Use the for sentence by the following writing.

 
int i; 
 Repeated sentence;
}
This I is a variable of the integer type, and it is used to count the frequency of the repetition.
This naturally It is necessary to declare i before the for sentence is used.
The following program is an example of displaying the message ten times by using the for sentence.
 
#include <stdio.h> 

int main(void)  
{
	int i;  
	 Printf (" message \n");
	}
	return 0;
}
The execution result of this program is as follows.

Message
Message
Message
Message
Message
Message
Message
Message
Message
Message
It is understood to be displayed to count ten times.

It returns to contents.


[2] Display of frequency

I see ..it is possible to repeat.. when the for sentence is used.
At this time, the variable used might be called a count variable.
The count variable Though anything is good even if it is not i
In C language, in the custom There seem to be a lot of people who use i.

The value of the frequency is repeatedly a variable It is possible to know at any time by referring to i.
The following program is an example of displaying the frequency of the repetition.

 
#include <stdio.h> 

int main(void)  
{
	int i;  
	 Printf ("Time %02d \n" i);
	}
	return 0;
}
The execution result of this program is as follows.

The 01st
The 02nd
The 03rd
The 04th
The 05th
The 06th
The 07th
The 08th
The 09th
The tenth
When the result is seen, it is understood to be displayed ten times splendidly.

It returns to contents.


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