i want to write a program to compute the Fibonacci numbers (max 20 numbers).but i want to do it using a class.

i wrote this and i want your opinions.

it computes the Fibonacci numbers for given num and then prints the result.

should i change anything?

Code:class fib { private: int fibar[20]; public: fib(); void create_nums(int); void show(int); }; void fib::show(int n) { for(int i=0;i<n;i++) cout<<fibar[i]<<"\n"; } fib::fib() { memset(fibar,0,sizeof(int)*20); fibar[1]=1; } void fib::create_nums(int n) { for(int i=2;i<n;i++) fibar[i]=fibar[i-2]+fibar[i-1]; } main() { fib obj; int num; cout<<"give N:"; do{ cin>>num; }while(num>20 || num<0); obj.create_nums(num); obj.show(num); }