I am using Bode\'s formuala to calculate distance of nth planet from sun
dist = (4 + 3*(2^(n-2)))/10
If I calculate the distance this way,
Because ^ is not the power operator in C++. You can use std::pow but with double or you can do a lot of casting to make it work with int.
^
std::pow
double
int