first commit

This commit is contained in:
Jose Caban
2025-06-07 11:38:03 -04:00
commit e0316ca3ff
79 changed files with 3155 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
subroutine fizzbuzzsub(n)
implicit none
integer, intent(in) :: n
integer :: i
do i = 1, n
if ((modulo(i,3) == 0) .OR. (modulo(i,5) == 0)) then
if (mod(i,3)==0) then
write(*, "(a)", advance="no") "Fizz"
end if
if (mod(i,5)==0) then
write(*, "(a)", advance="no") "Buzz"
end if
else
write(*, "(i0)", advance="no") i
end if
print *,""
end do
end subroutine fizzbuzzsub
program fizzbuzz
implicit none
integer :: n
integer :: Reason
print *, "How many fizzbuzzes?: "
read (*,*,IOSTAT=Reason) n
if (Reason > 0) then
print *, "Invalid input"
else
call fizzbuzzsub(n)
end if
end program fizzbuzz