program select_example2

  implicit none
  integer :: num
 
  num = 61
  select case (num)
    case (6,9,99,66)
      print*, "woof woof"
    case (10:65,67:98)
      print*, "bow wow"
    case default
      print*, "Meeeeow"
  end select

!-- if block method:  much more cumbersome
  if (num == 6 .or. num == 9 .or. num == 66 .or. num == 99) then
    print*, "IF: woof woof"
  elseif ((num >= 10 .and. num <=65).or.(num >= 67 .and. num <= 98)) then
    print*, "IF: bow wow"
  else
    print*, "IF: Meeeeow"
  endif     

end program select_example2
