Constants And Variables In Algorithms

Constants and variables are an identifier used to represent a certain value in the aktivitas process. In contrast to constants whose value can not be altered or always remain an excessive hose going on, the value of a variable may change as needed. Constants and variables are places in the computer memory to convey data in the form of values ​​with certain data types. Constants and variables should be named as identifiers.

Logically you can imagine a constable or a variable as an empty box that can be filled with something of a certain data type, for example we create an integer variable, then in logic we are creating an empty box that can only be filled with paper inscribed integers, may be a type other than an integer.

Suppose to create two constants or variables with the name of the value and x identifier each of which can be used to store a value in memory in accordance with the specified data type:




Suppose the value is a variable. Then the value variables that have been made this selajutnya can be used in the program, for example performed arithmetic operations in the form of division or modulo operations.

The image below shows an illustration of the operations that occur on the value variable. In this case the value variable is divided by number 2, and the result of the division operation is stored in a new variable named the quotient. Another arithmetic operation that occurs in the figure below is the value variable which module with the number 2 and the result stored in a new variabel named sides for. Operation on a constant or variable is not limited to arithmetic operations, but can also be a comparison operation. Suppose that the value is greater than the number 10 and others. An example of using a value variable in a simple duduk perkara is the determination of a number included in the odd or even category as shown in Figure 2



Similarly this article.
Sorry if there is a wrong word.
The end of word wassalamualaikum wr. wb

Referensi :
  • Ebook Logical and Algorithm

Sumber http://matematikaakuntansi.blogspot.com

Berlangganan Informasi Terbaru:

0 Response to "Constants And Variables In Algorithms"

Posting Komentar