Friday, May 6, 2011
Rekursif : Calculating the Value Program with Recursive Factorial (Program Menghitung Nilai Faktorial dengan Rekursif)
In mathematics, the factorial of n natural numbers is the result of multiplication of positive integers less than or equal to n. Factorial written as n! and is called n factorial.
For example, 5! is worth 5×4×3×2×1 = 120.
The definition is recursive, which is defined for n>= 0
C++ is recursively defined as follows
referensi :
Posted by dyas90 at 5:55:00 AM 0 comments
Posts Relacionados
Tuesday, May 3, 2011
Jeliot version : Make a Pyramid Star with Jeliot (Menbuat Piramida Bintang dengan Jeliot)
Sometimes - sometimes at the university each began learning the looping problem (loop) we will see a task to create a pyramid of stars. Therefore I will discuss the issue and help solve it.
To create a pyramid of stars we have to use nested loops. Nested iteration loops is contained in the loop. The loop is suitable for making this pyramid is using for loop. Why choose for loop? Because of this loop for sure. We will repeat how many times can be determined easily.
How does the writing program ?
Here I use the compiler Jeliot, so that the manufacturing process can be seen easily. So it can easily to be understood. First we create a loop to limit / line. After that we created also in the loop iteration space in order to print can bitang sebada middle. The second we live looping to create a star print.
Let not this footage dizziness program :
// to determine the line
for (baris=1;baris<=tinggi;baris ++){
//print the space
for (i=1;i<=tinggi-baris;i++){
System.out.print(" ");
}
//star print
for (j=1;j<2*baris;j++){
System.out.print("*");
}
System.out.println();
}
After dbuat program and will run resulting in output like the following :
Posted by dyas90 at 5:26:00 AM 0 comments
Posts Relacionados
Monday, May 2, 2011
Phytagoras : Calculating the Triangle Elbow Side (Menghitung Sisi Segitiga Siku - Siku)
In mathematics, the Pythagorean theorem is a relation in Euclidean geometry among the three sides of a right triangle. This theorem named after the Greek philosopher and mathematician, 6th century BC, Pythagoras. Pythagorean theorem is often regarded as the inventor of this despite the fact that the facts of this theorem is already known by mathematicians Indian, Greek, Chinese and Babylonians long before Pythagoras was born. Pythagoras is credited as the first to prove the universal truth of this theorem by mathematical proofs.
Pythagorean Theorem states that :
Extensive number of squares on the legs of a right triangle equals the area in square hipotenus. Or more akrapnya is the square of the hypotenuse equals the sum square of the other.
A triangle is a triangle having a right angle; his feet are two sides that form a right angle, and hipotenus is a third side opposite the right angle is. In the picture below, a and b are the legs of a right triangle and c is hipotenus :
c2 = a2 + b2
Pythagorean theorem states goemetris in style, as a broad statement about the square:
Extensive number of blue squares and red squares equals the area purple.
Extensive number of blue squares and red squares equals the area purple.
For that I want to create a program that can calculate the one side of the triangle seku - elbow. In this program there is the selection of inputs. Side - which side are already known so that it can be input and the unknown side of the output.
For the formula I created like this :
referensi : wikipedia.com
Posted by dyas90 at 8:46:00 AM 0 comments
Posts Relacionados
Subscribe to:
Posts (Atom)