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 HW04_01
implicit none
integer, dimension(4) :: array1 =(/-2, 0, 2, 4/)
integer, dimension(4) :: array2, array3, array4
integer:: i

print*, "Part a"
print*, "(4I3)" , array1

do i=1,4
array2(i)=2*(i-2)
end do
print *, "Part b"

print 200, array2
200 format (4I3)

print *, "Enter 4 digit values "
read (*,*) array3(1), array3(2), array3(3), array3(4)
print *, "Part c"
print"(4I3)", array3

do i=1,4
array4(i)=array1(4-i+1)
end do
print *, "Part d"
print "(4I3)", array4
end program HW04_01

Compile and Execute FORTRAN-95 Online

program HW04_01
implicit none
integer, dimension(4) :: array_01 =[/-2, 0, 2, 4/]
integer, dimension(4) :: array_02, array_03, array_04
integer:: i

print*, "part a"
print*, "(4I3)" , array_01

do i=1,4
array_02(i)=2*(i-2)
end do
print *, "part b"

print 200, array_02
200 format (4I3)

print *, "Enter 4 digit values "
read (*,*), array_03(1), array_03(2), array_03(3), array_03(4)
print *, "part c"
print"(4I3)", array_03

do i=1,4
array_04(i)=array_01(4-i+1)
end do
print *, "part d"
print "(4I3)", array_04
end program HW04_01

Compile and Execute FORTRAN-95 Online

program HW04_01
implicit none
integer, dimension(4) :: array_01 =[/-2, 0, 2, 4/]
integer, dimension(4) :: array_02, array_03, array_04
integer:: i

print*, "part a"
print*, "(4I3)" , array_01

do i=1,4
array_02(i)=2*(i-2)
end do
print *, "part b"

print 200, array_02
200 format (4I3)

print *, "Enter 4 digit values "
read (*,*), array_03(1), array_03(2), array_03(3), array_03(4)
print *, "part c"
print"(4I3)", array_03

do i=1,4
array_04(i)=array_01(4-i+1)
end do
print *, "part d"
print "(4I3)", array_04
end program HW04_01

Compile and Execute FORTRAN-95 Online

program hello
   real, dimension(20) :: x
   real, dimension(20) :: y
   integer :: i
   
   x = [0.2481,  0.4133,   0.4961,  0.4618,  0.3686, &  -0.0495,  -0.3477,  -0.4219, -0.4954, & -0.4156,  -0.4162,  0.3258, -0.0574,   0.2749, &  -0.1003,  -0.2711 ,   0.0383 ,  -0.3934,   0.3173,  -0.2402]
   
   y=x
   
   do i= 2,20,1
   y(i)= x(i) + y(i-1)
   end do 
   print *, y(1), y(2), y(3), y(4), y(5)
   print *, y(6), y(7), y(8), y(9), y(10)
   print *, y(11), y(12), y(13), y(14), y(15)
   print *, y(16), y(17), y(18), y(19), y(20)
end program Hello

celcius

program temp_conversition
    implicit none
    real ::fahrenheit,celsius
      print*,"type value celsius"
    read*,celsius
      print*,"celsius"
    fahrenheit=1.8*celsius+32.0
      print*, "fahrenheit=", fahrenheit
end program temp_conversition

Compile and Execute FORTRAN-95 Online

program hello
   Print *, "Hello World!"
end program Hello
program hello
    print *, "Heloo Word!"
end program hello

Compile and Execute FORTRAN-95 Online

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

Compile and Execute FORTRAN-95 Online

program hello
integer :: i
character(len=100) :: subject
integer :: st=0
print *, 'enter the number'
read(*,*)i
do while (i<0 .or. i>999)
print *, 'sorry the number is not in range'
read(*,*)i
end do
if (i<99) then
subject = 'General works computer science and information'
else if (i<199) then
subject = 'Philosphy and Psychology'
else if (i<299) then
subject = 'Religion'
else if (i<399) then
subject = 'social sciences'
else if (i<499) then
subject = 'Language'
else if (i<599) then
subject = 'Pure Science'
else if (i<699) then
subject = 'Technology'
else if (i<799) then
subject = 'Arts and recreation'
else if (i<899) then
subject = 'Literature'
Else
Subject = 'History and geography'
end if
print *, 'ddc :', subject
end program Hello

Practice

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

Compile and Execute FORTRAN-95 Online

program HW03_01
    implicit none
    real:: x,y
    print*, 'Enter real numbers for x and y'
    read*, x,y
    if (x > y) then
      print*, 'larger number=', x
    else if (y > x) then
      print*, 'larger number=', y
    else
      print*, 'x=y'
    endif
end program HW03_01

Advertisements
Loading...

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