Hi guys , today we are going to some math programsfor development of our logical ability in that way we need to think of the programming waysSimple Factorial CalculationsThe definition of a factorial: n! = n x (n-1) x (n-2) x ... x 1
|
| |||||||
Basic LoopingLet's learn the white loop today. It looks like this... while (condition) { Examples: are the following True or False? false: 0 | What are conditions? Boolean logic that evaluates to "true" or "false". Numerical: Zero is "false" and non-zero is "true". Comparison operators: ==, !=, <, <=, >, => Text: undefined is "false" and defined is "true". Comparison operators: eq, ne, lt, le, gt, ge Logical grouping Order of operations ** | |||||||
Basic Looping Part 2Now we can write a better factorial program!
Another example, print out your name 100 times
|
Friday, September 19, 2008
Small math ( factorial ) basic program with perl
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment