Program Arithmetic !------------------------------------------------------------------------------ ! Chris Harper CMSC 215 January 24, 2008 ! Assignment #2 ! ! Program to add and subtract two real numbers. Variables used are: ! X, Y : the two real numbers ! Sum : the sum of X and Y ! Difference : the difference of X and Y ! ! Output: X, Y, Sum, and Difference !------------------------------------------------------------------------------ IMPLICIT NONE Real :: Alpha, Beta, Sum, Difference Alpha = 17.2375 Beta = 2.057 ! Now calculate the sum Sum = Alpha + Beta ! Now calculate the difference Difference = Alpha - Beta Print *, "Sum of", Alpha, " and", Beta, " is", Sum Print *, "Difference of", Alpha, " and", Beta, " is", Difference End program Arithmetic