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.180 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.179 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.178 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.177 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.176 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.175 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.174 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.173 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.172 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.171 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.170 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.169 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.167 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.166 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.165 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.164 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.163 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.162 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.161 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.160 tracks/fortran/exercises/difference-of-squares/example.f90