Jump to content

Condition if


---
 Share

Recommended Posts

Hello. I have a question. How can you write a condition in PCM that checks whether one number is greater than another. And if the assumption is true, it should give the number 1, and if it is false, then 0. Example: If 10>5, choose 1, and if not, then 0.
Thank you for your help.
Link to comment
Share on other sites

The standard "beginners" construct goes like this:
num1=5
num2=10

if num2 > num1 then
	res=1
else
	res=0
endif
Note that it also returns 0 if both numbers are equal
Link to comment
Share on other sites

 Share

×
×
  • Create New...