Difference between revisions of "If a number lies between two values"

From MyWiki
Jump to: navigation, search
(Created page with "<sourcs lang = "Powershell"> $numLow = 1 $numHigh = 10 $testNum = 5 if(($testNum -gt $numLow) -and ($testNum -lt $numHigh)) { Write-Host "Number $testNum is between the...")
(No difference)

Revision as of 16:53, 16 December 2022

<sourcs lang = "Powershell"> $numLow = 1 $numHigh = 10

$testNum = 5

if(($testNum -gt $numLow) -and ($testNum -lt $numHigh)) {

   Write-Host "Number $testNum is between the range."

} else {

   Write-Host "Number $testNum is outside of the range."

} </source>