[ForTran 17]if then else if then Statement in ForTran

Опубликовано: 06 Апрель 2026
на канале: Bishon Sharma
230
1

Program if_then_else_if
integer day
write(*,*)'Enter the day i.e 1 for Sunday...'
read(*,*)day
if(day.eq.1) then
Write(*,*)'The Day is Sunday'
else if(day.eq.2) then
Write(*,*)'The Day is Monday'
else if(day.eq.3) then
Write(*,*)'The Day is Tuesday'
else if(day.eq.4) then
Write(*,*)'The Day is Wednesday'
else if(day.eq.5) then
Write(*,*)'The Day is Thursday'
else if(day.eq.6) then
Write(*,*)'The Day is Friday'
else if(day.eq.7) then
Write(*,*)'The Day is Saturday'
else
write(*,*)'The Day is not a valid day of week'
end if
end