part1c - WRITE(*,*) 'The minimum value is:', MINVAL(array)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
PROGRAM part1c IMPLICIT NONE INTEGER::n, status, i REAL::variance REAL, ALLOCATABLE, DIMENSION(:)::array WRITE(*,*)'Enter the number of values contained in the array:' READ(*,*)n ALLOCATE(array(n),STAT=status) IF(status/=0) STOP 'Allocation error' WRITE(*,*)"Enter the",n,"values contained in the array:" READ(*,*) array WRITE(*,*) 'The maximum is',MAXVAL(array)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: WRITE(*,*) 'The minimum value is:', MINVAL(array) WRITE(*,*) 'The average is:', SUM(array)/2.0 variance=((SUM(array**2)/n)-(SUM(array)/n)**2) WRITE(*,*) 'The variance is:', variance WRITE(*,*) 'The standard deviation is:', sqrt(variance) DEALLOCATE(array,STAT=status) IF(status/=0) STOP 'Deallocation error' END PROGRAM...
View Full Document

This note was uploaded on 07/22/2010 for the course MAE 112 taught by Professor Freeh during the Spring '10 term at North Country Community College.

Ask a homework question - tutors are online