SIMPLE PROGRAMS
7: FORTRAN 77 program which reads two values in two variables and then exchange the values.
integer a,b,temp
write(*,*)'Enter
first value'
read(*,*)a
write(*,*)'Enter
second value'
read(*,*)b
write(*,*)'Values
before exchanging : '
write(*,*)'A = ',a
write(*,*)'B = ',b
temp=a
a=b
b=temp
write(*,*)'Values
After exchanging : '
write(*,*)'A = ',a
write(*,*)'B = ',b
stop
end
0 Comments