char choice = '2';
double num = 2.6, gain = 5.5, result;
if (choice = '1')
result = num*gain*gain;
else if (choice = '2')
result = num / 3*gain;
else
result=0;
cout<<result<<endl;
Firstly this code is wrong.
This: if (choice = '1')
is assigning the value of '1' to your choice variable. It is not testing for equality.
You want something like this: if (choice == '1')
i.e. 2 equal signs.
Why is that so?
You can step through the code with a debugger, looking at the values of your variables at each step.