answersLogoWhite

0

<html>

<body>

<script type="text/vbscript">

Dim a, b, c, n, nth

a = 0

b = 1

n = Cint(InputBox("Enter the value of ""n"""))

For nth = 1 to n Step 1

Document.Write(b&"<br/>")

c = a + b

a = b

b = c

Next

</script>

</body>

</html>

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How do you find out how many digits are in integer using vbscript?

num=32767 MsgBox(len(num))


How do find factorial using vbscript?

&lt;html&gt; &lt;script language="vbscript"&gt; n=cint(inputbox("Enter a number")) dim f f=1 if n&lt;0 then Msgbox "Invalid number" elseif n=0 or n=1 then MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f else for i=n to 2 step -1 f=f*i next MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f end if &lt;/script&gt; &lt;/html&gt;


Fibbomacci series using recursion shell programming?

Here is a good answer for recursion Fibonacci series. #include &lt;stdio.h&gt; #include &lt;conio.h&gt; long Fibonacci(long n); int main() { long r, n,i; printf("Enter the value of n: "); scanf("%ld",&amp;n); for(i=0;i&lt;=n;i++) { printf(" Fibonacci(%ld)= %ld\n", i,Fibonacci(i)); } getch(); return 0; } long Fibonacci(long n) { if(n==0 n==1) return n; else { return (Fibonacci(n-1)+Fibonacci(n-2)); } } for n=5; Output: Fibonacci(0)=0 Fibonacci(1)=1 Fibonacci(2)=1 Fibonacci(3)=2 Fibonacci(4)=3 Fibonacci(5)=5


Write a program to print the Fibonacci series in php upto input value using recursive function?

The Fibonacci sequence uses recursion to derive answers. It is defined as: F0 = 0 F1 = 1 Fn = F(n - 1) + F(n -2) To have this sequence printed by a php script use the following: function fibonacci($n) { if($n 1) return 1; //F1 else return fibonacci($n - 1) + fibonacci($n - 2); //Fn } This recursive function will print out the Fibonacci number for the integer n. To make it print out all the numbers in a particular set add this to your script. for($i = 0; $i &lt; 15; $i++) { echo fibonacci($i) . "&lt;br /&gt;"; } So your final result would look like. &lt;?php function fibonacci($n) { if($n 1) return 1; else return fibonacci($n - 1) + fibonacci($n - 2); } for($i = 0; $i &lt; 15; $i++) { echo fibonacci($i) . "&lt;br /&gt;"; } ?&gt;


Write a program to generate the Fibonacci series using non-recursive method?

In c: int fibr(int n) { // Find nth Fibonacci number using recursion. if (n&lt;=2) return 1; // the first two Fibonacci numbers are 1 and 1 return (fibr(n-2)+fibr(n-1)); } int fibi(int n) { // Find nth Fibonacci number using iteration. int temp,last=1,f=1; int i; for (i=3;i&lt;n;++i) { // the first two Fibonacci numbers are 1 and 1 temp=f; f+=last; last=temp; } return f; }

Related Questions

What number in the Fibonacci sequence between 100 and 200 is a perfect square?

Answer 144 which is F(12) Reason 55 and 89 are the 10th and 11th Fibonacci numbers, If we add these we have 144 which is the 12 Fibonacci number and is a perfect square. I am using F(0) as the 0 Fibonacci number and F(1) as the first.


Home page containing pull down menu box for the links using vbscript?

Home page containing pull down menu box for the links using VBScript.


How does the golden ratio relate to the Fibonacci sequence?

The golden ratio is approximately 1.618: 1. This ratio is commonly found in nature and architecture. Stock traders often look for this ratio in patterns on stock charts. One way to compute this ratio is to compare any adjacent Fibonacci numbers. For this reason stock traders often refer to this type of analysis using the term Fibonacci, as in "Fibonacci retracements".


How do you compute aog by lmp?

using your lmp,just add the number of day of the day of assessment and divide it by the number of months.


What is a Fibonacci sequence using 84?

The Fibonacci sequence requires two numbers as "seeds".


How do you calculate the nth term in the Fibonacci sequence using C?

what? Assuming you wanted an algorithm to find the nth number in the Fibonacci sequence: double Fib(int i) { double x = 1; double y = 1; if (i


What is the Fibonacci sequence and how can kids understand and learn about it?

The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting with 0 and 1. Kids can learn about it through fun activities like creating Fibonacci art, exploring nature for Fibonacci patterns, or using toys like blocks or Legos to visually represent the sequence.


How do you find out how many digits are in integer using vbscript?

num=32767 MsgBox(len(num))


How do you compute the probability distribution of a function of two Poisson random variables?

we compute it by using their differences


How do find factorial using vbscript?

&lt;html&gt; &lt;script language="vbscript"&gt; n=cint(inputbox("Enter a number")) dim f f=1 if n&lt;0 then Msgbox "Invalid number" elseif n=0 or n=1 then MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f else for i=n to 2 step -1 f=f*i next MsgBox "The factorial of given number "&amp;n&amp;" is :"&amp;f end if &lt;/script&gt; &lt;/html&gt;


What has the author Sloan Trasher written?

Sloan Trasher has written: 'Building web applications using VBScript' -- subject(s): World Wide Web, HTML (Document markup language), VBScript (Computer program language)


What can compute the slope of a line by using the slope?

A protractor.