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

Calculate twice sum of two numbers using Fortran

program ex4
! calculate twice sum of two numbers
real::a,b
read*,a,b
answer=(a+b)*2
print*, answer
end program ex4

Compile and Execute FORTRAN-95 Online

program ex22
! ths program is to print the name
integer::I
do I=1,10
print*,'my name is chandralekha'
end do
end program ex22

problem 3

program hello
   Print *, "Hello World!"
end program Hello

Compile and Execute FORTRAN-95 Online

program ex21
!this program calculates the value
integer::a,b,y
read*,a,b
if (a>b)then
y=a**2
else
y=b**2
end if 
print *,"y=",y
end program ex21

Compile and Execute FORTRAN-95 Online

program ex21
!this program is to calculate the value
integer ::a,b,y
read*,a,b
if (a>b) then
y=a**2
else
y=b**2
end if 
print *,"y=",y
end program ex21

Compile and Execute FORTRAN-95 Online

program ex20
!this program calculates 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 a
! to repeat
integer ::i
do i=3,23
   Print *, "Nadeem Roshan"
   end do
end program a

Compile and Execute FORTRAN-95 Online

program ex19
!this program compares two numbers
integer::a,b
read*,a,b
print*,"a=",a,"b=",b
if (a>b)then
print*,"max value a=",a
else
print*,"max value b=",b
end if 
end program ex19

Compile and Execute FORTRAN-95 Online

program ex21
! calculate the value of 
integer ::a,b,y
read *, a,b
if (a>b) then
y=a**2
else 
y= b**2
end if
   Print *, "y=",y
end program ex21

program 20

program ex20
! this program is to calculate the value 
integer::a,b,y
read*,a,b
if (a>b) then
y=2*(a*b)
else 
y=2*(a+b)
end if
Print *, 'y=', y
end program ex20

Advertisements
Loading...

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