answersLogoWhite

0

#include<iostream.h>

#include<conio.h>

void main()

{

long int n,a=0,b=1;

cout<<"dear user Enter number as u wish";

cin>>n;

while(n>0)

{

c=a+b;

cout<<"c<<"\t\t";

a=b;

b=c;

}

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

How do i Write a programme to show the fabonasi numbers?

Step 1. Learn the word "Fibonacci"...


Write a java program to print the last digit in Fibonacci series?

Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.


How do you write a c program to calculate the Fibonacci series of a given number?

To write a C program that calculates the Fibonacci series up to a given number, you can use a loop to generate the series. Start by initializing the first two Fibonacci numbers (0 and 1) and then repeatedly compute the next number by adding the two preceding numbers until you reach or exceed the specified limit. Here’s a simple example: #include &lt;stdio.h&gt; int main() { int n, t1 = 0, t2 = 1, nextTerm; printf(&quot;Enter a positive integer: &quot;); scanf(&quot;%d&quot;, &amp;n); printf(&quot;Fibonacci Series: %d, %d&quot;, t1, t2); for (int i = 3; i &lt;= n; ++i) { nextTerm = t1 + t2; printf(&quot;, %d&quot;, nextTerm); t1 = t2; t2 = nextTerm; } return 0; } This program prompts the user for a number and prints the Fibonacci series up to that number.


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;


Would you Write c plus plus program using array for Fibonacci number?

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....

Related Questions

How do i Write a programme to show the fabonasi numbers?

Step 1. Learn the word "Fibonacci"...


How do write searching number programme in java?

give description of that then i will send the answer


Write a C programme to count the number of vowals present in your name?

abhimanyu


Write a java programme to check whether the number is twin prime or not?

Find a prime number, add 2 to the number. Check if the new number is prime. IE : 3 is prime. 3+2 =5. 5 is prime. (3,5) are twin primes.


Write a java program to print the last digit in Fibonacci series?

Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.


Write a programme for substraction of two numbers in c language?

substracion of any two number program in c


How do you write a c program to calculate the Fibonacci series of a given number?

To write a C program that calculates the Fibonacci series up to a given number, you can use a loop to generate the series. Start by initializing the first two Fibonacci numbers (0 and 1) and then repeatedly compute the next number by adding the two preceding numbers until you reach or exceed the specified limit. Here’s a simple example: #include &lt;stdio.h&gt; int main() { int n, t1 = 0, t2 = 1, nextTerm; printf(&quot;Enter a positive integer: &quot;); scanf(&quot;%d&quot;, &amp;n); printf(&quot;Fibonacci Series: %d, %d&quot;, t1, t2); for (int i = 3; i &lt;= n; ++i) { nextTerm = t1 + t2; printf(&quot;, %d&quot;, nextTerm); t1 = t2; t2 = nextTerm; } return 0; } This program prompts the user for a number and prints the Fibonacci series up to that number.


How do you write a poem with number patterns?

To write a poem with number patterns, start by deciding on a specific numerical structure, such as a syllable count or line length that follows a sequence (e.g., Fibonacci, where each line has a number of syllables corresponding to Fibonacci numbers). Next, choose a theme or subject that resonates with you and allows for exploration through your chosen pattern. As you write, let the constraints inspire creativity, weaving imagery and emotions that align with the numerical structure. Finally, revise to ensure the poem flows well while maintaining the established pattern.


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


Write an algorithm to check whether a number is a prime number or not?

You can write out this algorithm. This will then be programmed into the device to make determining prime numbers easier.


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;


How do you write an acrostic poem for the word Fibonacci?

Fibonacci's first name was leonardoItaly was were he was bornBorn in ....O,1,1,2,3,5,8,13...Natually a geniusA simple person who became famousConsidered to be the best mathmatitionCreator of the Fibonacci sequenceI....{think for your self lazy}by Donhead pupil in year 6

Trending Questions
What is a drawn visual? Can a ratchet strap be used for the lifting of equipment? If you are working on a fast moving production line and the machine you are operating jams? What is double voltage double frequency test? What does the word vent mean? Why do the current readings differ for increasing and decreasing values of the incandescent lamp wattages? Why would a generator put out 240 volt single phase? What robots can and can't do? The valve seat performs two functions It provides a seal for the valve in the combustion chamber and it provides a cool surface to carry heat away from the valve. Most valves use degree seating angle? Write a 'c' program to calculate the frequencies of different alphabets present in a given string the string of alphabets is to be taken as input from the keyboard? What person who checks before printing is called? During the Renaissance time from 1400s to 1600s what advancements were there in science or technology? What Flanders was known for manufacturing? What is DCS experience for a chemical operator? Why would electric cost more on a three phase system as compared to a two phase system? Who invented plaster in 1912? What is the relationship between science and technology give the examples of their relationship? What is the purpose of the series resistor in test pencil? How many tags are in a regular element? What are the softwares or languages that i should learn along with software testing tools like QTP to become a good software testing engineer?