Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 If statements
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nikea8




PostPosted: Sat Apr 16, 2016 11:47 pm   Post subject: If statements

Hello. I wanna do an if/then statement. I want the user to input a number, and have an if statement saying that if the number is higher than 5 then it runs something different than if the inputed number is lower than 5. What code do I use for that?
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sun Apr 17, 2016 8:17 am   Post subject: RE:If statements

Maybe you could do something with the > and < operators.
Zainabh




PostPosted: Sun Apr 17, 2016 7:03 pm   Post subject: RE:If statements

For example

var number:int

put "Please enter a number."
get number

if number>5 then
put "Hello"
else
put "Goodbye"
end if
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: