Finite State Machine

From Progzoo

(Difference between revisions)
(Even Binary Numbers)
(Even Binary Numbers)
Line 4: Line 4:
 
<question class='EvenBinary'>
 
<question class='EvenBinary'>
 
<prog><![CDATA[
 
<prog><![CDATA[
public class EvenBinary {
+
public class P{
  
 
   public static void main(String[] args) {
 
   public static void main(String[] args) {
Line 50: Line 50:
 
}
 
}
 
]]></prog>
 
]]></prog>
The function '''fact''' takes a single integer input. The result is that number times by each of the numbers smaller - down to one.
+
</question>
fact(1) =  1        =  1
+
fact(2) =  1*2      =  2
+
fact(3) =  1*2*3    =  6
+
fact(4) =  1*2*3*4  =  24
+
fact(5) =  1*2*3*4*5 = 120
+
</question>
+
  
 
==What is the function==
 
==What is the function==

Revision as of 19:25, 16 February 2012

Finite State Machines

Contents

Even Binary Numbers


[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]


What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]