language: Fortran (gfortran-4.3.4)
date: 119 days 15 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PROGRAM DANGEROUSMATH
!---------------------------------------------------------------------------------
!Karl Harris                             ENGR225              1-25-12
!I predict the outcome to be "A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0
 
IMPLICIT NONE
integer,parameter ::dp=selected_real_kind(15) !15 sig figs
Real(dp) ::  A,B, x, C, mu
Integer :: I, K, n = 9
Character(10) :: Name
A=3
B=(n+3)/5
X=5.75d0
I=3.1415959
K=x/2.0
mu=1./5.75
 
Write(*,*)"Please enter your name"
Read(*,*) Name
 
Write(*,*) "Hello", Name
 
Write(*,*)" I predict the outcome to be A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0 " 
Write(*,*) a,b,x, I, k, mu
 
Write(*,*) "Enter a value for A & B"
Read(*,*) A, B
C=((A+B)**2-2*A*B-B**2)/A**2
Write(*,*) C
STOP
END PROGRAM DANGEROUSMATH
 
 
  • upload with new input
  • result: Success     time: 0.02s    memory: 2620 kB     returned value: 0

    Karl
    0.01 888.0
    
     Please enter your name
     HelloKarl      
      I predict the outcome to be A= 3.0,B= 2.0,x= 5.75, I= 3, k= 2, mu= 0 
       3.0000000000000000        2.0000000000000000        5.7500000000000000                3           2  0.17391304671764374     
     Enter a value for A & B
       1.0000000003174137