The order of the streets of a program can be controlled and are directed by using commands to control groove program.Apa it mean to control program flow, which is a program that uses the condition or state (logical thinking) to direct measures which will in ambil.Sebagai example, where who will be selected, that this or that, for this choice there needs to be a condition or state of tertentu.Contoh in everyday life for example, when (if) in the house there is sugar, then the (then) I'll make some coffee, if not (else) I will drink water only.
To direct the flow of a program by using the program flow control statements are generally carried out using for, if, while and switch.Perintah for and while loop will repeat a set of statement-ngulang long as this condition is true (TRUE). The command will run once if repeated on several stament if the conditions TRUE, will use conditions or the information to run several statements that meet the conditions or the suitable information.
IF ORDERS
This command is a command to check a condition (logic operation) before executing a statement or commands berikutnya.secara outline format, if the statement is as follows:
If (condition)
Statement
If the command will check whether a condition is true (TRUE) or false (FALSE). If you get a command if the conditions are right, if this command will immediately run some statement by the road without any perulangan.Contoh, the original value of the variable $ b is equal to 4 , then if the variable $ a is worth 3, change the contents of the variable $ b to the number 5, if not, let the contents of the variable $ b is still filled with the number 4:
$ b = 4;
if ($ a == 3) $ b = 5;
Else Statement
Else statement is always used together with a statement or command if.Secara outline format of the use of else is as follows:
if (condition)
statement
else
statement
If the if statement to check that the condition is false (FALSE), which will be run is under the else statement. For example, if $ a is not equal to 3, $ b is filled with 6:
if (condition)
$ b = 4;
else
Else if Statement
elseif statement is always used together with a statement or command if.Secara outline the format of the elseif statement is as follows:
if (condition)
Statement
elseif
Statement
else
Statement
If the if statement to check that the condition is false (FALSE), which will be run is this elseif statement. Then, if the elseif statement to check that the condition is true (TRUE), the statement below will elseif elseif statement dijalankan.Jika on bahwqa check the condition of (FALSE), which will run the statement below else.Contoh,
if $ a = 3, then $ b = 4, except that if $ c = 7, $ b = 8, if $ c is not equal to 7, $ b
if ($ a == 3) $ b = 4;
elseif $ c == 7) $ b = 8;
else $ b = 9;
To direct the flow of a program by using the program flow control statements are generally carried out using for, if, while and switch.Perintah for and while loop will repeat a set of statement-ngulang long as this condition is true (TRUE). The command will run once if repeated on several stament if the conditions TRUE, will use conditions or the information to run several statements that meet the conditions or the suitable information.
IF ORDERS
This command is a command to check a condition (logic operation) before executing a statement or commands berikutnya.secara outline format, if the statement is as follows:
If (condition)
Statement
If the command will check whether a condition is true (TRUE) or false (FALSE). If you get a command if the conditions are right, if this command will immediately run some statement by the road without any perulangan.Contoh, the original value of the variable $ b is equal to 4 , then if the variable $ a is worth 3, change the contents of the variable $ b to the number 5, if not, let the contents of the variable $ b is still filled with the number 4:
$ b = 4;
if ($ a == 3) $ b = 5;
Else Statement
Else statement is always used together with a statement or command if.Secara outline format of the use of else is as follows:
if (condition)
statement
else
statement
If the if statement to check that the condition is false (FALSE), which will be run is under the else statement. For example, if $ a is not equal to 3, $ b is filled with 6:
if (condition)
$ b = 4;
else
Else if Statement
elseif statement is always used together with a statement or command if.Secara outline the format of the elseif statement is as follows:
if (condition)
Statement
elseif
Statement
else
Statement
If the if statement to check that the condition is false (FALSE), which will be run is this elseif statement. Then, if the elseif statement to check that the condition is true (TRUE), the statement below will elseif elseif statement dijalankan.Jika on bahwqa check the condition of (FALSE), which will run the statement below else.Contoh,
if $ a = 3, then $ b = 4, except that if $ c = 7, $ b = 8, if $ c is not equal to 7, $ b
if ($ a == 3) $ b = 4;
elseif $ c == 7) $ b = 8;
else $ b = 9;
Tidak ada komentar:
Posting Komentar
1. "Blog ini Do Follow, silakan post untuk mendapatkan Backlink"
2. "Anda Follow, pasti saya Followback"
3. "Kalau mau Copy-Paste artikel boleh saja, tapi sumbernya ke blog ini"
4. "Terima Kasih Lagi . . . !!!"
Komentar Anda Sangat Kami Harapkan Untuk Kemajuan Blog Ini. isikan komentar anda disini !