Sha256: b85a64a04da57acb555a00bce9d1f11d0e6e2b0e6f5c1dd313d5a7f3d5cfc326

Contents?: true

Size: 670 Bytes

Versions: 213

Compression:

Stored size: 670 Bytes

Contents

module difference_of_squares
  contains
  integer function square_of_sum(n)
    implicit none
    integer :: i,n

    square_of_sum = 0

    do i = 1,n
      square_of_sum = square_of_sum + i
    end do

    square_of_sum = square_of_sum * square_of_sum
  end function square_of_sum

  integer function sum_of_squares(n)
    implicit none
    integer :: i, n

    sum_of_squares = 0

    do i = 1,n
      sum_of_squares = sum_of_squares + i**2
    end do

  end function sum_of_squares

  integer function difference(n)
    implicit none
    integer :: n

    difference = square_of_sum(n) - sum_of_squares(n)
  end function difference

end module difference_of_squares

Version data entries

213 entries across 213 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.158 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.157 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.156 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.155 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.154 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.153 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.152 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.151 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.150 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.149 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.148 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.147 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.146 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.145 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.144 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.143 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.142 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.141 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.140 tracks/fortran/exercises/difference-of-squares/example.f90