fork download
  1. program weekday_weekend
  2. implicit none
  3. character(len=11)::c_day
  4. character(len=11)::c_type
  5. print *,'Enter the name of the day:'
  6. read *,c_day
  7. select case(c_day)
  8. case('Monday','Tuesday','Wednesday','Thursday','Friday')
  9. c_type='Weekday'
  10. case('Saturday','Sunday')
  11. c_type='Weekend'
  12. case default
  13. c_type='Invalid day'
  14. end select
  15. print *,'Day Type=',c_type
  16. end program
Success #stdin #stdout 0s 5316KB
stdin
sunday
stdout
 Enter the name of the day:
 Day Type=Invalid day