there are two scripts, first, square.h second square.cpp
this test program is trying to calculate square and cube of the given number
but i have a problem with cube function definition.
#include <iostream>
#include <conio.h>
using namespace std;
class square {
int x;
public:
void set_values (int);
int erek () {return (x*x);}
void set_values_3 (int);
int erek_3() {return (x*x*x);}
};
void square::set_values (int a) {
x = a;
void square::set_values_3 (int a) {
x = a;
}
#include <iostream>
#include <conio.h>
#include "square.h"
using namespace std;
int main () {
int number;
cout <<"enter a number=\n";
cin >> number;
square burcin;
burcin.set_values (number);
burcin.set_values_3 (number);
cout << "square of "<<number <<" is: " << burcin.erek();
cout << "cubes of "<<number <<" is: " << burcin.erek_3();
getch();
}