Skip to main content
10-Marble
Nov 8, 2023 7:30 AM UTC
Solved

if-else statements with "or" validation

how would you do the following in Mathcad: 

 

if  (x = 1  or x = 2)

     return "yes"

else

     return "no" 

 

thank you.

CornelAnswer
19-Tanzanite
Nov 8, 2023 8:20 AM UTC

Cornel_0-1699431643669.png

 

2 replies

23-Emerald V
Nov 8, 2023 7:35 AM UTC

exactly like you wrote it, but with "or" replaced with the OR operator. You'll find it in the operators overview, it looks like a large V.

 

Success!

Luc

Translate
Cornel19-TanzaniteAnswer
19-Tanzanite
Nov 8, 2023 8:20 AM UTC

Cornel_0-1699431643669.png

 

Translate