473,804 Members | 3,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fibinocci series

Hi to every body,
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.

thank U in advance

Nov 15 '05 #1
47 4577
shan <sr**********@g mail.com> wrote:
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.


(I smell a troll or a homework cheater. If you're neither, read the
links below and try again. Otherwise, get lost.)

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Nov 15 '05 #2
On 26 Oct 2005 07:49:31 -0700, in comp.lang.c , "shan"
<sr**********@g mail.com> wrote:
Hi to every body,
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.


google is your friend...

Though you may want to spell fibonacci properly....!
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #3
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
shan <sr**********@g mail.com> wrote:
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.


What if the user asks for ten billion? What if the user asks
for so many that the number does not fit within an integer?
What if the user asks for negative 17?
--
Many food scientists have reported chocolate to be the single most
craved food. -- Northwestern University, 2001
Nov 15 '05 #4
On 2005-10-26, Walter Roberson <ro******@ibd.n rc-cnrc.gc.ca> wrote:
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
shan <sr**********@g mail.com> wrote:
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.
What if the user asks for ten billion? What if the user asks
for so many that the number does not fit within an integer?


Such as, say, ten billion? (on many systems in use today, that won't
even fit in an unsigned long)

and of course the series itself will overflow long before you get to
that many.
What if the user asks for negative 17?

Nov 15 '05 #5
In article <sl************ ********@random .yi.org>,
Jordan Abel <jm****@purdue. edu> wrote:
On 2005-10-26, Walter Roberson <ro******@ibd.n rc-cnrc.gc.ca> wrote:
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
shan <sr**********@g mail.com> wrote:
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++.
What if the user asks for ten billion? What if the user asks
for so many that the number does not fit within an integer?
and of course the series itself will overflow long before you get to
that many.


Well, since the OP asked for "complete" code, I kind of assumed that
the OP would need the indefinite-precision libraries to go along with
everything else...
--
Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us. -- Ecclesiastes
Nov 15 '05 #6
On 2005-10-26, Walter Roberson <ro******@ibd.n rc-cnrc.gc.ca> wrote:
In article <sl************ ********@random .yi.org>,
Jordan Abel <jm****@purdue. edu> wrote:
On 2005-10-26, Walter Roberson <ro******@ibd.n rc-cnrc.gc.ca> wrote:
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
shan <sr**********@g mail.com> wrote:
I am a begginer in C.can anybody give the complete code for fibinocci
series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how
many numbers to be printed.I am using turbo c++. What if the user asks for ten billion? What if the user asks
for so many that the number does not fit within an integer?

and of course the series itself will overflow long before you get to
that many.


Well, since the OP asked for "complete" code, I kind of assumed that
the OP would need the indefinite-precision libraries to go along with
everything else...


indefinite-precision, you say?

doubt it'll work on his "turbo c++", but...

system("dc -e '?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx'");

....what? what's everyone looking at?

--
I'm ashamed to admit i wrote that by hand.
Nov 15 '05 #7
In article <sl************ ********@random .yi.org>,
Jordan Abel <jm****@purdue. edu> wrote:
indefinite-precision, you say? doubt it'll work on his "turbo c++", but... system("dc -e '?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx'"); ...what? what's everyone looking at?


$ dc -e '?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx'
Usage: dc [OPTION] [file ...]
--help display this help and exit
--version output version information and exit
$ dc
?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx
dc: stack empty
1
dc: register 'c' (0143) is empty
dc: stack empty
1

--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Nov 15 '05 #8
On 2005-10-26, Walter Roberson <ro******@ibd.n rc-cnrc.gc.ca> wrote:
In article <sl************ ********@random .yi.org>,
Jordan Abel <jm****@purdue. edu> wrote:
indefinite-precision, you say?

doubt it'll work on his "turbo c++", but...

system("dc -e '?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx'");

...what? what's everyone looking at?


$ dc -e '?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx'
Usage: dc [OPTION] [file ...]
--help display this help and exit
--version output version information and exit
$ dc
?sc1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx
dc: stack empty
1
dc: register 'c' (0143) is empty
dc: stack empty
1


meh

well, this won't let the user input 10 billion, but...

prompt for your input;
FILE *fp = popen("dc","w") ;
fprintf(fp,"%ds c1sx1sy[lxlyplx+sxsy]sI[lIxlc1-sclc0<L]sLlLx",n);
pclose(fp);

....your dc has gnu options but no ? or -e? - how about the output of
that "version information?

or maybe not, since now we're firmly into off-topic territory.
Nov 15 '05 #9
On 2005-10-26, shan <sr**********@g mail.com> wrote:
Hi to every body,
I am a begginer in C.can anybody give the complete code for
fibinocci series (0 1 1 2 3 5 8 ...)an input is get from user
to calculate how many numbers to be printed.I am using turbo
c++.

thank U in advance


You're welcome in advance.

--
Neil Cerutti
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
459
by: Sriram Krishnan [at] gmx [dot] net | last post by:
Given an arbitrary number series, how do I identify the series and find the Nth number... for e.g 1,3,5,7 is an AP and the next number will be 9 1,8,27,64 is the series of cubes and the next will be 125 1,1,2,3,5,8 is the Fibonacci series The thing is I'll be given the series only...I have to identify the series and find the next number. Pointers on how to do this please ... Regards, Sriram
6
13505
by: Daniel Kabs | last post by:
Hello there, I have a Nokia 6630 phone that is based on the Series 60 Software Platform. -> http://www.series60.com/ These "smartphones" are said to support HTML 4.01 and "a subset of JavaScript 1.5, which includes the most commonly used functions found on the Internet". -> http://www.nokia.com/nokia/0,8764,58711,00.html
0
1566
by: melledge | last post by:
XML Master Series - XML 2005 - November 14-18 - Hilton Hotel - Atlanta, GA IDEAlliance in its continued efforts to provide groundbreaking services to the XML community is introducing the XML Master Class Series the first of which will be held at XML 2005. The Master Class Series brings together successful XML use cases presented by users and industry experts to provide insight and practical guidance into today's XML standards,...
4
1790
by: aW | last post by:
I have an interesting dilemma. I have a table with the following records: =================================================== Box | Series Start | Series End ========+=======================+================== 1 | 0001 | 0025 --------------------------------------------------- 2 | 0026 | 0050
1
1862
by: Sriram Krishnan [at] gmx [dot] net | last post by:
Given an arbitrary number series, how do I identify the series and find the Nth number... for e.g 1,3,5,7 is an AP and the next number will be 9 1,8,27,64 is the series of cubes and the next will be 125 1,1,2,3,5,8 is the Fibonacci series The thing is I'll be given the series only...I have to identify the series and find the next number. Pointers on how to do this please ... Regards, Sriram
4
3013
by: geoffp | last post by:
I need to generate reproducible random number series. I've done the obvious - use mt_srand with the same seed. This supposedly will create the same series every time. Is this true? Its not working for me. By the way, seeding mt_srand with different integers doesn't necessarily produce different series. I've done a little testing and every pair of consecutive even and odd numbers produces the same series. eg. seed 0 and 1
4
5923
by: keirnus | last post by:
Hello, I've been coding in Access VBA to create an Excel Graph and it was good. Until I got this error: Please check the code below: Private Sub TestGraph3()
1
3095
by: Scholar | last post by:
Hi,i am working on a c++ project which will find the nth term of a given series.The series would be given in the form of first 4 or 5 terms.I have the basic alogorithm which can find the nth term of a polynomial series given initial terms.The problem being tht the number of initial terms required is proportional to order of the series.So,as the order of polynomial series increases ,we need more number of initial terms. I shall oblidge if...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10580
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7621
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.