ﻁﻳﺳﺑ ﺞﻣﺎ�ﺭﺑ ﺔﺑﺎﺗﻛ ﻝﻼ� ﻥﻣ ﺎﻬﺗﺎﻣﺍﺩﺧﺗﺳﺍﻭ To write anew FORTRAN program follow the

ﻁﻳﺳﺑ ﺞﻣﺎ?ﺭﺑ ﺔﺑﺎﺗﻛ

This preview shows page 5 - 12 out of 18 pages.

ﻁﻳﺳﺑ ﺞﻣﺎﻧﺭﺑ ﺔﺑﺎﺗﻛ ﻝﻼﺧ ﻥﻣ ﺎﻬﺗﺎﻣﺍﺩﺧﺗﺳﺍﻭ To write anew FORTRAN program follow the following steps 1 – After executing Fortran 90 compiler the following screen will appear 2 – From File menu select NEW -> PROJECT WORKSPACE -> Console application after entering the project name then choose Create
Image of page 5

Subscribe to view the full document.

6 3 -The following screen will appear then choose New Source file FILE NAME New Source
Image of page 6
7 4 – Write the source code then File -> save as -> file name 5 – Compile the source code by choosing Build Compile filename 6 – If the source program is error free then execute the program by choosing Build Execute program name SUMMERY: To write a program using FORTRAN 90 programming language, follow the following steps SOURCE PROGRAM AREA
Image of page 7

Subscribe to view the full document.

8 1) Create a project workspace . FILE NEW Project Workspac e 2) Write the source program. (Inside the source program area) 3) Compile the source program. BUILD COMPILE 4) Execute the program. BUILD EXECUTE ﺔﻟﻭﻠﺣﻣ ﺔﻠﺛﻣﺍ 1 ( ﺩﺍﺩﻋﻻﺍ ﻉﻭﻣﺟﻣ ﺩﺎﺟﻳﻻ ﻲﺑﺎﻳﺳﻧﻻﺍ ﻁﻁﺧﻣﻟﺍ ﻡﺳﺭﺍ 1 ..... 100 ﻁﻁﺧﻣﻟﺍ ﻝﻭﺣ ﻡﺛ ﻡﺍﺩﺧﺗﺳﺎﺑ ﻥﺍﺭﺗﺭﻭﻓ ﺔﺟﻣﺭﺑﻟﺍ ﺔﻐﻠﻟ Do ……. Loop Start Do K = 1,100 Sum=0 Sum = Sum+K Write Sum End Program P1 Integer:: K,Sum Do K = 1,100 Sum = Sum + K End do Print *,Sum End End Do ﺳﺎﺑ ﻥﺍﺭﺗﺭﻭﻓ ﺔﺟﻣﺭﺑﻟﺍ ﺔﻐﻠﻟ ﻁﻁﺧﻣﻟﺍ ﻝﻭﺣ ﻡﺛ ﺔﻳﻟﺎﺗﻟﺍ ﺔﻟﺩﺎﻌﻣﻟﺍ ﻝﺣﻟ ﻲﺑﺎﻳﺳﻧﻻﺍ ﻁﻁﺧﻣﻟﺍ ﻡﺳﺭﺍ Y = 7 + X – X 3 + X 5 - ………………………… X n Start Y=7 S = 1 Do K = 1,n,2 Y = Y + S*X K S = S * (-1) Read X,n Write Y End Program P2 Integer:: K,S Real :: Y,X Y = 7 S = 1 Read *,X,n Do K = 1,n Y= Y + X**k S = -s End do Print *,Sum End
Image of page 8
9 2 ( ﺩﺍﺩﻋﻻﺍ ﻉﻭﻣﺟﻣ ﺩﺎﺟﻳﻻ ﻲﺑﺎﻳﺳﻧﻻﺍ ﻁﻁﺧﻣﻟﺍ ﻡﺳﺭﺍ 1 ..... 100 ﻡﺍﺩﺧﺗﺳﺎﺑ ﻥﺍﺭﺗﺭﻭﻓ ﺔﺟﻣﺭﺑﻟﺍ ﺔﻐﻠﻟ ﻁﻁﺧﻣﻟﺍ ﻝﻭﺣ ﻡﺛ Do ……. Loop Start Do K = 1,100 Sum=0 Sum = Sum+K Write Sum End Program P1 Integer:: K,Sum Do K = 1,100 Sum = Sum + K End do Print *,Sum End End Do 3 ( ﻡﺍﺩﺧﺗﺳﺎﺑ ﻥﺍﺭﺗﺭﻭﻓ ﺔﺟﻣﺭﺑﻟﺍ ﺔﻐﻠﻟ ﻁﻁﺧﻣﻟﺍ ﻝﻭﺣ ﻡﺛ ﺔﻳﻟﺎﺗﻟﺍ ﺔﻟﺩﺎﻌﻣﻟﺍ ﻝﺣﻟ ﻲﺑﺎﻳﺳﻧﻻﺍ ﻁﻁﺧﻣﻟﺍ ﻡﺳﺭﺍ Do ……. Loop Y = 7 + X – X 3 + X 5 - ………………………… X n Start Y=7 S = 1 Do K = 1,n,2 Y = Y + S*X K S = S * (-1) Read X,n End Do Write Y End Program P2 Integer:: K,S Real :: Y,X Y = 7 S = 1 Read *,X,n Do K = 1,100 Y= Y + X k S = S * (-1) End do Print *,Sum End
Image of page 9

Subscribe to view the full document.

10 4 ( 1 3 5 n Y = - ---- + ---- ---- ………………….. ---- X X 3 X 5 X n For X = 2 , N = 7 n X K S Y 7 2 0 1 -1 0 – (1 / 2) 3 1 0 – (1 / 2) + (3/2 3 ) 5 -1 0 – (1 / 2) + (3/2 3 ) - (5/2 5 ) 7 1 0 – (1 / 2) + (3/2 3 ) + (5/2 5 ) + (7/2 7 ) 9 -1 Y= – (1 / 2) + (3/2 3 ) + (5/2 5 ) + (7/2 7 ) Program P2 Real :: X, Y Integer :: K,S Read *,X,n Do K = 1 ,N.2 Y = Y + K / X k * s S = - S Enddo Print *, Y End
Image of page 10
11 5 ( 1 2 3 4 n Y = - ---- + ---- ---- + --- ………………….. ------- X X 3 X 5 x 7 X 2n-1 for X = 2 , N = 4 n X K S Y 4 2 0 1 -1 0 – (1 / 2) 2 1 0 – (1 / 2) + (2/2 3 ) 3 -1 0 – (1 / 2) + (2/2 3 ) - (3/2 5 ) 4 1 0 – (1 / 2) + (2/2 3 ) + (3/2 5 ) + (4/2 7 ) 5 -1 Y= – (1 / 2) + (2/2 3 ) + (3/2 5
Image of page 11

Subscribe to view the full document.

Image of page 12
  • Fall '16
  • Codd, nsum, CPOs, sumn, CNEG