How to resolve the algorithm Count in octal step by step in the Fortran programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Count in octal step by step in the Fortran programming language

Table of Contents

Problem Statement

Produce a sequential count in octal,   starting at zero,   and using an increment of a one for each consecutive number. Each number should appear on a single line,   and the program should count until terminated,   or until the maximum value of the numeric type in use is reached.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Count in octal step by step in the Fortran programming language

Source code in the fortran programming language

program Octal
  implicit none
  
  integer, parameter :: i64 = selected_int_kind(18)
  integer(i64) :: n = 0
  
! Will stop when n overflows from
! 9223372036854775807 to -92233720368547758078 (1000000000000000000000 octal)
  do while(n >= 0)
    write(*, "(o0)") n
    n = n + 1
  end do
end program


  

You may also check:How to resolve the algorithm DNS query step by step in the J programming language
You may also check:How to resolve the algorithm Sierpinski triangle/Graphical step by step in the PicoLisp programming language
You may also check:How to resolve the algorithm String concatenation step by step in the Slope programming language
You may also check:How to resolve the algorithm Colour pinstripe/Display step by step in the FutureBasic programming language
You may also check:How to resolve the algorithm Substring step by step in the Icon and Unicon programming language