')' and ';' expected help

Hello, I am a begginner using java and need some help. I get this error when compiling a small program:
')' expected
';' expected

this is the line of code it shows up on:

lucky = (int((100*m*m + 10*d*d*d)/y +Math.sqrt(Math.pow(w, 6)/h))%10+1);

I am not sure what I am missing. I've tried googling the problem but nothing has helped me so far. I appreciate the help and appologise if its some simple mistake I am missing.

Comments

  • justinmd,
    A cast uses parenthesis around the type.

    [code]lucky = [color=Blue](int)[/color] (((100*m*m + 10*d*d*d)/y + Math.sqrt(Math.pow(w, 6)/h))%10+1);[/code]

    gl,
    se52
  • Thank you so much that was it. I knew it was going to be something silly like that. It works fine now.

    Again thank you!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories