Showing posts with label for and while structure. Show all posts
Showing posts with label for and while structure. Show all posts

Monday, August 10, 2009

OK .... now we will start again in learnjavaprogram. This time related to the keyword while. Keyword in the previous 2 while there are:
While and Do-While

WHILE -> the process of looping with a particular selection, where during the process of looping the loop true value will continue to run.
syntax









See above there is a (var_selection), a variable that will hold the selection in the loop when walking. During var_selection values is correct, then in block akan While the execution.
The Example Program WHILE


















Control Structure WHILE

DO-WHILE -> looping process used is at least 1 time the localization.
syntax










statement in the block Do-While dikerjakan first time, and after that selection occurs in the keyword while. TRUE if the statement will then be reset, otherwise if FALSE exit from the loop.
The Example Program DO-While


























Control Structure DO-While

Wednesday, July 29, 2009

FOR -> is a keyword that is used to perform iteration with a digit numeric selection, in the form of integer or fractional.
syntax
for(value_first; limit; changes )
{//statement to be run}
in the code that appears to be filled with the original values and create a variable filled with the beginning of the process. To limit the content of the iteration limit, and the change is a value that changes the value of var to be the limit. Before running the program reached the limit statement in the for block.
Example For Increment
Description
The first value of i = 0, and then checked whether i <4 i =" 1"> 4 or i value false.


Example For Decrement
Description
almost the same as for increment, the value i only just started i = 3 or change the value of the decrement decrease.


Description of the road program in detail












Example of printing the program genap











Example of printing the program ganjil

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Macys Printable Coupons