questions
10/29/2008 6:13:00 AM
On 10?28?, ??7?56?, Zeppe
<ze...@remove.all.this.long.comment.yahoo.it> wrote:
> questions wrote:
> > # include <stdio.h>
> > # include <math.h>
> > int main()
> > { long int x,y;
>
> > printf("enter an integer\n");
> > scanf("%d",&x);
>
> > y=x%pow(10,3);
>
> > printf("the result is %d",y);
>
> > return 0;}
>
> > The compiler tell me there is something wrong with the "pow",but I
> > don't know what's the wrong?
>
> my compiler says:
>
> testmod.cpp:8: warning: format '%d' expects type 'int*', but argument 2
> has type 'long int*'
> testmod.cpp:10: error: invalid operands of types 'long int' and 'double'
> to binary 'operator%'
> testmod.cpp:12: warning: format '%d' expects type 'int', but argument 2
> has type 'long int'
>
> It looks pretty much clear. Listen to your compiler. It's your friend.
>
> Best wishes,
>
> Zeppe- ??????? -
>
> - ??????? -
thanks