Technology News, Micromax, Mobiles Flashing Software, Flash Tool, Pokemon GO Apk, Income Online, Moto G4 Plus, Sony PC, Latest Version, samsung note, Huawei Smartphone

Sunday, December 16, 2012

Tcl and OTcl Tutorial for NS2 - Program to find Factorial

Tcl and OTcl Tutorial for NS2 - Program to find Factorial - technology is getting more advanced every day .. if you want to know the progress that happened please visit this blog Technology News because it will always update the latest information, now we will discuss first about Tcl and OTcl Tutorial for NS2 - Program to find Factorial hopefully this information can answer the questions you submit to google, ok please see:

Articles : Tcl and OTcl Tutorial for NS2 - Program to find Factorial
full Link : Tcl and OTcl Tutorial for NS2 - Program to find Factorial

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://micromyaw.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"



information about Tcl and OTcl Tutorial for NS2 - Program to find Factorial has been completed in the discussion

hopefully information Tcl and OTcl Tutorial for NS2 - Program to find Factorial can benefit you in getting the latest information about technology,

you just read the article entitled Tcl and OTcl Tutorial for NS2 - Program to find Factorial if the article feel useful for you please bookmark or share by using link https://micromyaw.blogspot.com/2012/12/tcl-and-otcl-tutorial-for-ns2-program.html and thank you.

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

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

0 comments:

Post a Comment