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.119 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.118 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.117 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.116 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.115 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.114 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.113 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.111 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.110 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.109 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.108 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.107 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.106 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.105 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.104 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.103 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.102 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.101 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.100 tracks/fortran/exercises/difference-of-squares/example.f90
trackler-2.2.1.99 tracks/fortran/exercises/difference-of-squares/example.f90