Skip to content

Commit ab467d1

Browse files
authored
Update main.f90
1 parent 561809e commit ab467d1

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

main.f90

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
! Ataur Rahman
1+
! Last Updated on 19th Nov.
2+
! By Ataur Rahman
23
! M.Sc. Physics (Computational Physics)
34
! Central University of Punjab, Bathinda
45

@@ -7,19 +8,19 @@ program main
78
implicit none
89

910

10-
integer :: i,n
11-
real::a1,a2,err,rt
11+
integer :: i, n
12+
real :: a1, a2, err, rt
1213

13-
!write(*,*)" Enter the function:"
14-
!read(*,*)
14+
! write(*, *) " Enter the function:"
15+
! read(*, *)
1516

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
2324

2425
select case(i)
2526
case (1)
@@ -33,13 +34,10 @@ program main
3334

3435

3536
case default
36-
write(*,*)"Write a valid no."
37+
write(*, *) "Enter a valid number."
38+
write(*, *) "------------------------------------------------------------------------------"
3739

3840
end select
3941

4042

4143
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

Comments
 (0)