-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfortran90_code.f90
More file actions
31 lines (28 loc) · 1.03 KB
/
fortran90_code.f90
File metadata and controls
31 lines (28 loc) · 1.03 KB
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
! This is excercises for Computer programming in Fortran-90/95 by V Rajaraman, ISBN;9788120311817, PHI Leaning, Year-1999
! Chapter-2: Simple Fortran 90 Program
! Date: 29th March 2024
! Author: Amit(amitdravid@outlook.com), The University of Alabama, AL, USA
! Note: To run and compile an example program-code, comment other program-codes
! ==============================================================================================================
!Program 2.1
!This is find area and perimeter
program area_perimeter
real:: p,q,area,perimeter
print*, "Enter length:"
read*, p
print*, "Enter width:"
read*, q
area = p*q
perimeter = 2*(p+q)
print*, "Area =",area , "Perimeter =",perimeter
end program area_perimeter
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++
! Program 2.4
! This is to convert Celsius to Fahrenheit
program temp_conversion
real:: cel,fah
print*, "Enter temp in Celsius:"
read*, cel
fah = 1.8*cel+32
print*,"Temp. in Fahrenheit:", fah
end program temp_conversion