answersLogoWhite

0


Best Answer

a=0

b=1

c=0

For i=0 to whaterveryouwant

print c

c=a+b

a=b

b=c

next i

User Avatar

Wiki User

โˆ™ 2011-07-14 13:39:47
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
User Avatar
Study guides
4.25
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
4 Reviews

Add your answer:

Earn +20 pts
Q: Write a program to print the Fibonacci series 0 1 1 2 3 5 8-------20?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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 program to print the Fibonacci series in php upto input value using recursive function?

Is this a homework question?


Write a program to print the in series?

write a shell script to print thi format***************


Write a program to generate the fibonacci series in java?

Set two variables "a" and "b" to the starting number of the Fibonacci series, for example, 1 and 1. Then, repeatedly (i.e., in a loop) set: sum = a + b; b = a; a = sum; ... and print the sum (or equivalently, variable "a").


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


Can you write a program to print the Fibonacci series in php?

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 < 15; $i++) { echo fibonacci($i) . "<br />"; } So your final result would look like. <?php function fibonacci($n) { if($n 1) return 1; else return fibonacci($n - 1) + fibonacci($n - 2); } for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } ?>


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a program in C Sharp to print Fibonacci series using while loop?

//WAP to print fibonacci series using do-while loop.? using System; class Fibonacci { public static void Main() { int a=1,b=1; int sum=0; Console.Write("Enter Limit:"); int n=Int32.Parse(Console.ReadLine()); Console.Write(a); Console.Write(b); do { sum=a+b; a=b; b=sum; Console.Write(sum); } while(sum<n); } } By-Vivek Kumar Keshari


Write a c program to print the 100 to 1 nos?

Write a c program to print the 100 to 1 nos


Write a unix program to print print a pattern?

echo 'print a pattern'


Write a java program to print the result in the series?

If you have the series stored in an array, you loop through the array and print each array element in turn. Another possibility is to print out the numbers in the series as you generate them. In that case, you may not need to store anything (depending on the series, of course).


What is the program to print Fibonacci series in qbasic?

CLS a = 0 b = 0 FOR i = 1 TO 10 IF a = 0 THEN f = 1 END IF PRINT f b = a a = f f = a + b NEXT i END from : Parth jani parthjani7@yahoo.com


How do you Write a C program to print a Series of Odd Numbers and Even Numbers.?

Reference:cprogramming-bd.com/c_page2.aspx# divisible


How do you write a program to print Fibonacci series of n numbers using recursion in cpp?

#include<iostream> unsigned fib (unsigned term, unsigned a=0, unsigned b=1) { if (term<1) return a; return fib (--term, a+b, a); } int main() { std::cout << "Fibonacci (1000th term): " << fib (1000) << std::endl; }


Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number using function in c plus plus language?

I am not so sure about C++, but Python is somewhat similar. def awesome_function() number = input("The number you would like to use?") for i in range(number) print(i) Great question! ^^


Can you write a C program to print your name?

#include<stdio.h> void main() {printf("Your name\n"); }


Write a program in visual basic to find Fibonacci series?

Private Sub Command1_Click() Dim x,g,n,i,sum as Integer n=Val(Text1.Text) x=0 y=1 Print x Print y for i=3 To n Sum = x + y Print Sum x = y y = Sum Next i End Sub


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a program to print Fibonacci series upto n terms Number of terms should be taken from the user?

void main() { int n,old=0,curr=1,new=0; clrscr(); printf("enter the total number of terms up to which you want to print the Fibonacci series"); scanf("%d",&n); printf("%d",old); printf("\n%d",curr); for(i=1;i<=n;i++) { new=old+curr; old=curr; curr=new; printf("\n%d",new); } getch(); }


How do you write a c plus plus program to print Fibonacci series?

#include<iostream> using namespace std; int main() { cout << "Fibonacci sequence up to 100... int f1 = 0; int f2 = 1; cout << f1 << endl; while (f2<100) { cout << f2 << endl; int next = f1 + f2; f1 = f2; f2 = next; } }


How do you write a qbasic program?

type: PRINT "I like chocalate!"


Write a program in BASIC to find the sum of the series s equals 2 plus 4 plus . plus 100?

10 print "That is not a question." 20 print "That is a command." 30 end


Write a Program to print multiplication table?

write a c program that prints out the multiplication table of 4 using function


Write a program to extract a portion of a character string and print the extracted string Assume that m?

write a c++ program to extract a portion of a character string and print extracted string


Write a c program to print?

#include int main (void) { puts ("print"); return 0; }