answersLogoWhite

0


Best Answer

//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

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

What is the question?

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a shell program to generate fibnacci series using while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


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).


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 ?


Write a c program to solve cos series?

Please do.


Can you write a program to generate sinx table where x varies from 0 to 180 in steps of 15?

Yes, I can.


Write a program to generate uppercase using cSharp?

string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);


Write a c program to generate student mark details using union and find total and average and grade?

write a c program to display marks,total,average,grade using union


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Write a c program to generate Fibonacci series using copy constructor?

#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n&lt;=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }


How do I write a program to do the following... Write a VBA code to take the TippingBucketData.txt file and process it to generate an output file.?

Without knowing the contents of the TippingBucketData.txt file nor how to process it, it would be impossible to say how such a program would be written.


Write a program to find the sum of sine series?

Writing a program for a sum of sine series requires a rather long formula. That formula is: #include #include #include main() { int i,n,x; .


Write a program using while loop that generates Fabonaci series up to 200?

//to generate Fibonacci series upto a range of 200....(in C).... #include&lt;stdio.h&gt; main() { int a,b,c,i; a=0; b=1; printf("\n FIBONACCI SERIES .....\t"); i=1; while(i&lt;=(200-2)) { c=a+b; printf("\t%d",c); a=b; b=c; i++; } }