pow() 函数的问题
我在tc 2.0上运用该函数时,输出的值总是不对:
#include <stdio.h>
main()
{int x,y ;
scanf("%d%d",&x,&y);
while( x)
{
printf("\n%d\n",(int)pow((double)x,(double)y)); /*因为这个函数原型要求参数为double,而我忘了double 在scanf()中是用啥格式字符了:)*/
scanf("%d%d",&x,&y);
}
}
/*
whatever i input 3,5 or 2, 3,or other input
the output all is 255*/
please tell me how to use the function pow(),thanks !