This blog displays information about the latest android smartphone, price and specs as well as information applikaksi game that appeals to you, here are also a lot of software that you can download

Minggu, 16 Desember 2012

Tcl and OTcl Tutorial for NS2 - Program to find Factorial

Tcl and OTcl Tutorial for NS2 - Program to find Factorial - is looking for information, and in this blog Android Gadgets we have been providing very complete information from various sources that reliable, well we'll talk about the Tcl and OTcl Tutorial for NS2 - Program to find Factorial as you need, please si read to completion.

Articles : Tcl and OTcl Tutorial for NS2 - Program to find Factorial
full Link : Tcl and OTcl Tutorial for NS2 - Program to find Factorial
Article factorial, Article network simulator, Article NS2, Article otcl, Article Procedures, Article Program, Article tcl, Article Tcl script, Article tutorial,

You can also see our article on:


Tcl and OTcl Tutorial for NS2 - Program to find Factorial



 Fractorial Computation: tcl script to obtain the value of 10! = 10 * 9 * ... * 1.

  1. get  http://androidtabletgadgets.blogspot.com /" rel="nofollow" target="_blank">factorial.tcl and run the script;
  2. write a function to compute 2^x, test your answer.
Execute the script as:

$ tclsh lab1a.tcl
or
$ ns lab1a.tcl



################################################################################


#filename : factorial.tcl
# define function to compute Factorial X!
proc Factorial {x} {
    # define variable
    set result 1
   
    # for loop
    for {set i 1} {$i <= $x} {incr i} {
set result [expr $result * $i]
    }
   
    # return computation result
    return $result
}


#############################################################################


# define function to compute 2^x
proc 2pow {x} {
    # define variable
    set result 1
   
    # for loop
    for {set i 1} {$i <= $x} {incr i} {
# fill in here
    }
   
    # return computation result
    return $result
}
# make function call
set result [Factorial 10]

# output result
puts "$result"

# make function call
set result [2pow 10]

# output result
puts "$result"



Articles Tcl and OTcl Tutorial for NS2 - Program to find Factorial has been discussed

A few gadget information Tcl and OTcl Tutorial for NS2 - Program to find Factorial, hopefully can provide benefits to you all.

You're reading an article Tcl and OTcl Tutorial for NS2 - Program to find Factorial and this article url is https://androidtabletgadgets.blogspot.com/2012/12/tcl-and-otcl-tutorial-for-ns2-program.html?m=0 you can bookmark , Hopefully this article could be useful and do not forget to always to this blog to find information on gadget.

Tag : , , , , , , , , ,
Share on Facebook
Share on Twitter
Share on Google+

Related : Tcl and OTcl Tutorial for NS2 - Program to find Factorial

0 komentar:

Posting Komentar