1 Replies - 497 Views - Last Post: 10 August 2009 - 12:02 PM Rate Topic: -----

#1 f.noces  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-August 09

if-else declaration terminated incorrectly

Posted 10 August 2009 - 11:51 AM

im trying to correct the code, but unfortunately can't move on due to this error: declaration terminated incorrectly. Please help..

if x>25.0{
y=x
else
y=z;;}
Is This A Good Question/Topic? 0
  • +

Replies To: if-else declaration terminated incorrectly

#2 bimbolena  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 50
  • Joined: 09-August 09

Re: if-else declaration terminated incorrectly

Posted 10 August 2009 - 12:02 PM

View Postf.noces, on 10 Aug, 2009 - 10:51 AM, said:

im trying to correct the code, but unfortunately can't move on due to this error: declaration terminated incorrectly. Please help..

if x>25.0{
y=x
else
y=z;;}


Uhm, those brackets and ; is all over the place!

Use

if(x>25.0)
  y=x;
else
  y=z;



or

if(x>25.0) {
  y=x;
} else {
  y=z;
}



Feel free to mess me on MSN Live if you need more help. I'm bored.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1