! Copywright Tommi Bergman, Jarmo Pirhonen, and Sami Saarinen (Fortran 95 -course at CSC, 2010).
! Fix the code
PROGRAM squaresum
  IMPLICIT NONE

  WRITE (*,*) 'Result: ', sqsum(1.0)
  WRITE (*,*) 'Result: ', sqsum(2.0)
  WRITE (*,*) 'Result: ', sqsum(5.0)
contains
  REAL FUNCTION sqsum(x)
    IMPLICIT NONE
    REAL, INTENT(IN) :: x
    REAL :: sqsu 
    sqsu= 0.0
    sqsu = x**2+sqsu
    sqsum = sqsu
  END FUNCTION sqsum

END PROGRAM squaresum
