Showing posts with label Algorithm. Show all posts
Showing posts with label Algorithm. Show all posts

THOERY ALGORYTH UNNES

Monday, December 19, 2011 · 0 comments

The theory of algorithms and programming as part of a class of materials informatics and computer engineering education UNNES.
merupkan following its files. please download.

MAKE A FLOWCHAR

· 0 comments

AlproExample flowchart1. The algorithm: 

1. Initialize the value of pi = 3.142. Enter the numbers that will be the radius of the circle or the radius3.    Calculating the circumference of a circle with the formula kel = 
2 * pi * radius

4. Then print the result5. Calculating area of ​​a circle with the formula
          
area = 0.5 * pi * radius * rasius6. Then print the result

 2. The algorithm:1. Inserting the value of the temperature in Celsius2. Calculate the temperature conversion from Celsius to Fahrenheit by the formulaF = C * 1.8 + 323. Then print the results into Fahrenheit
 
3. The algorithm:1. Initialize a = 112. Calculate an odd number from 10 to 30 by using the formulafor (a = 11; a <= 30; a + = 2)3. Are the results in an odd number are included the numbers 21 and 274. If yes, then proceed to continue the statement and then print the next number5. If not, print the result directly
 
4. The algorithm:1. Enter the value of a, b, and c2. Calculate the determinant by the formula D = b * b - 4 * a * c3. If the results are equal to zero (D = 0), then there are two rea

STORAGE CLASS

Thursday, January 13, 2011 · 0 comments

Storage Class

  
Every variable and function in C has two attributes: type and storage-
class. There are 4 kinds of storage-class: automatic, external, register and static. Keyword-its own: auto, extern, register, static.
Keyword auto is used to explicitly declare the storage-class automatic.
example:
auto int a, b
auto float f;



Variables declared within a block is automatic, the implicit. So the auto keyword is rarely used. Meaning of auto storage-class If a block to have entered, the memory allocated for variables automatic. These variables are local in the block. At that time block left (exit block), the memory allocated for the variable- auto variables that become free again. So the value of this auto variables be lost. If the block is entered again later, the system allocates more memory for auto variables, but the previous value is not known.
So the lifetime of an auto variable block adalh since it entered to date blocknya abandoned.

Strorage-class extern

  • One way to distribute information across blocks and across functions is to use an external variable. 
  • Variables declared outside the function gets memory allocation 
  • permanent (as long as the active program). Storage-classnya extern.

Archives