Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute FORTRAN-95 Online

program t22
! this program calculate the sum of numbers from low to high
integer::x,y,sum,i
read*,x,y
print*,"low number is",x
print*,"high number is",y
sum=0
do i=x,y
sum=sum+i
end do
print*,"the sum from low to high",sum
end program t22

problem 20

program ex20
! this program is to calculate the doubled product of two numbers
integer::a,b,y
read*,a,b
if (a<b) then
y=2*a*b
else 
y=2*(a+b)
end if
print*,y
end program ex20

Compile and Execute FORTRAN-95 Online

program t24
! this program read 10 numbers
integer::m,n,i
m=0
n=1
do i=1,10
read*,a
m=m+a
n=n*a
end do
print*,'sum of 10 numbers is',m
print*,'product of 10 numbers is',n
end program t24

problem 18a

program ex18a
! this program is to find value of y
integer::x,y
read*,x
if (x>2) then
y=-2+3*x
else 
y=8+x**2
end if
print*,y
end program ex18a

problem 17

program ex17
! this program calculates the values of the variables
real::m,n,c
m=67
m=m+13
n=(m/4)+(m/2)
c=m*n
print*,'m=',m
print*,'n=',n
print*,'c=',c
end program ex17

Square of all numbers 1 to 10 using Fortran

program test21
! square of all numbers 1 to 10
integer::x,i
do i=1,10
x=i**2
print*,x
end do
end program test21

Calculate the area of square using Fortran

program ex9
! calculate the area of square
real::a
read*,a
area=a**2
print*,area
end program ex9

Calculate the perimeter of rectangle using Fortran

program ex7
! calculate the perimeter of rectangle
real::a,b
read*,a,b
answer=(a+b)*2
print*,answer
end program ex7

Calculates from low to high using Fortran

program t21
!this program calculates from low to high
integer::x,i
do i=1,10
x=i**2
print*,x
end do
end program t21

Print number from 1 to 10 using Fortran

program ex22
! print number from 1 to 10
integer::i
do i=1,10
print*,i
end do
end program ex22

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.