Come on now!
This is your second question today, and they are both fairly simple things that a quick check with a debugger would have found.
SO, lets try and debug it shall we?
Use the debugger: put a breakpoint on the line:
scanf("%f,%f",&num,&exp);
And run your program.
When it stops, single step the debugger and enter your two numbers: "2,3" will do.
When you press ENTER, you will be back to the debugger.
So - look at the two numbers you just entered.
What's the value of
num
? For me, it's 2.0000000
What's the value of
exp
? For me it's 1077936128
Now, that's not right!
So look at your code, and see if you can see why it's wildly inaccurate!
What is the difference between the two variables
num
and
exp
and how you use them?