FIBO - while (i<(x-2)) {...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream.h> #include<conio.h> class fibo { int a,b,c; public: fibo() { a=0; b=1; c=a+b; } void calc(int); }; void fibo :: calc (int x) { int i=0; cout<<a<<" "<<b;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: while (i&lt;(x-2)) { cout&lt;&lt;&quot; &quot;&lt;&lt;c; a=b; b=c; c=a+b; i++; } } void main() { int m; cout&lt;&lt;&quot;Enter value of m&quot;; cin&gt;&gt;m; fibo f; f.calc(m); }...
View Full Document

Ask a homework question - tutors are online