1
- ! Ataur Rahman
1
+ ! Last Updated on 19th Nov.
2
+ ! By Ataur Rahman
2
3
! M.Sc. Physics (Computational Physics)
3
4
! Central University of Punjab, Bathinda
4
5
@@ -7,19 +8,19 @@ program main
7
8
implicit none
8
9
9
10
10
- integer :: i,n
11
- real :: a1,a2,err,rt
11
+ integer :: i, n
12
+ real :: a1, a2, err, rt
12
13
13
- ! write(*,*) " Enter the function:"
14
- ! read(*,*)
14
+ ! write(*, *) " Enter the function:"
15
+ ! read(*, *)
15
16
16
- write (* ,* ) " Enter a integer for the following methods : "
17
- write (* ,* ) " Bisection method: 1"
18
- write (* ,* ) " Newton-raphson method: 2"
19
- write (* ,* ) " Regula-falsi method: 3"
20
- write (* ,* ) " Secant method: 4"
21
- write (* ,* ) " ------------------------------------------------------------------------------"
22
- read (* ,* ) i
17
+ write (* , * ) " Enter a number to choose a method : "
18
+ write (* , * ) " Bisection method: 1"
19
+ write (* , * ) " Newton-Raphson method: 2"
20
+ write (* , * ) " Regula-Falsi method: 3"
21
+ write (* , * ) " Secant method: 4"
22
+ write (* , * ) " ------------------------------------------------------------------------------"
23
+ read (* , * ) i
23
24
24
25
select case (i)
25
26
case (1 )
@@ -33,13 +34,10 @@ program main
33
34
34
35
35
36
case default
36
- write (* ,* )" Write a valid no."
37
+ write (* , * ) " Enter a valid number."
38
+ write (* , * ) " ------------------------------------------------------------------------------"
37
39
38
40
end select
39
41
40
42
41
43
end program main
42
-
43
- ! we need to run both the module and the main program togetherly using the command
44
- ! gfortran -o find xfind.f90 main.f90
45
- ! run the ./find to execute the output.
0 commit comments