instead of polynomial=3x^3-5x^2+6;
try using the "pow function" polynomial=3*pow(x,( 3))-5*pow(x,(2))+6;
You could declare x as const int x=?; above your polynomial variable;
logically it could work, but id google the pow function to make sure i wrote it right
its been a while since ive used it.