#include <iostream.h>
template <class t>
class fs
{
public:
void fab()
{
t a=0;
t b=1;
t c=0;
t numbers = 0;
t counter = 1;
cout << "How many Fibonacci number you need ? : " ;
cin >> numbers;
do {
counter++;
c=a+b;
cout<<"\t"<<c;
a=b;
b=c;
} while (counter <= numbers);
cout << endl;
}
};
void main()
{
fs <int> a;
a.fab();
}
template <class t>
class fs
{
public:
void fab()
{
t a=0;
t b=1;
t c=0;
t numbers = 0;
t counter = 1;
cout << "How many Fibonacci number you need ? : " ;
cin >> numbers;
do {
counter++;
c=a+b;
cout<<"\t"<<c;
a=b;
b=c;
} while (counter <= numbers);
cout << endl;
}
};
void main()
{
fs <int> a;
a.fab();
}