Here is the code that I couldn't figure out why it's not working (I'm always getting a result like 0.000000
):
#include <stdio.h>
#include <math.h>
int main ()
{
double num,b;
printf("Write a number between 0 and 256"); scanf("%lf",&num);
num = pow(2.0,b);
printf("%lf",b);
return 0 ;
}
Here, the answer of the pow is known as num since it's introduced by user, and I'm trying to find the value of b which is inside the function!
Actually, I saw similar questions here, but some of them were dependent on a solution of gcc, (I'm using Dev C++) and the rest had a structure which is slightly different and the problem may arise due to this difference.