my code freezes whenever i enter 12-19.
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
int multiples;
int answer;
int square;
int cube;
int num;
cout << "Please enter a positive number less than or equal to 20: ";\
cin >> num;
do
{
if(num >=20)
cout << "Invalid number. Enter another one in range." << endl;
cin >> num;
}while(num>0 && num <=20);
for(int num=1;num<=num;num++)
{
square = (num * num);
cube = (num * num * num);
}
cout << square << endl;
cout << cube << endl;
return 0;
system("pause");
}