Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial - this blog we have built from a few years ago and already very much information about gadgets that we convey and a lot of blog visitors
New Blog Techno News who are satisfied with the information, we will always try to update the latest information for you, first about Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial many already we collect data to make this article so you do not miss the news, please see:
Articles :
Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial
full Link :
Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial
You can also see our article on:
Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial
Fractorial Computation: tcl script to obtain the value of 10! = 10 * 9 * ... * 1.- get http://moymoycikukecik.blogspot.com /" rel="nofollow" target="_blank">factorial.tcl and run the script;
- 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 Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial finished in discussion
hopefully the information we convey about Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial can benefit you in getting new knowledge about technology,
you just finished reading the information Info Tcl and OTcl Tutorial for NS2 - Program to find Factorial we hope this informmation can answer the question you submit to googlle, if you want to bookmark or share please use link https://moymoycikukecik.blogspot.com/2012/12/info-tcl-and-otcl-tutorial-for-ns2.html and do not forget to always visit this blog to get the latest information every day.
Tag :
0 komentar:
Posting Komentar