0% found this document useful (0 votes)
128 views

Fortran Programming 2

The document appears to contain source code for one or more computer programs but it is difficult to determine what the programs are doing due to the unstructured formatting and presence of special characters. Some portions seem to involve reading input values, performing arithmetic operations and printing outputs but the overall functionality is unclear. The document does not provide enough clear information to summarize its purpose or content in 3 sentences or less.

Uploaded by

Kesev Keshav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views

Fortran Programming 2

The document appears to contain source code for one or more computer programs but it is difficult to determine what the programs are doing due to the unstructured formatting and presence of special characters. Some portions seem to involve reading input values, performing arithmetic operations and printing outputs but the overall functionality is unclear. The document does not provide enough clear information to summarize its purpose or content in 3 sentences or less.

Uploaded by

Kesev Keshav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

I X * 2151041 M Bu

q -

h l1

1i m k

a * w er

( u

(* )

4_

* W# h

f tw

pa

A I f que

l dr a .

1l

l 0a

( I O w B r l a

an

ob1ervettwfol toqj bgprt)uun


i n t e ge r
r e a d+

x
x

i f i: x Ge ) m
i f ( y Gl ) d l e n
*
p r in t x + y / 2
el
p r i n t + ea l ( x
y )/ 2
e n die
e lw

a Ad x
p r ir u
yy 2
,

de s c r i b e th e

( I)

(i i )

( i i i) x

p r o du c ed i r

ut

Bl n

dy

an

dy

5 and y

Scanned by CamScanner

a r

tl

ly

a n

1y

W o qu

AR
*

t io

in

a n

le a s e

t k p 20 \ ) \ R } R r R A N h

( b ) i l A1s e Bv

e t he

tb l lo

r ead

i 1w ) S a

u l i r u u Bu

u m

in g pr o g iu

I I 1a w w

11t

T1r a r k
i t c i 1i a r k G 0 ) t h e n
i t c m a r k Ge 8 0 ) t h e n
'
'
e x c e l le n t
p r in t
eBs e i t c n 1a > k Ge 7 0 ) t h e n
.

p r in t
go o d
e l s e i tc m a r k
Ge 5 0
'
*
th i r '
p r in t
'

'

) t he n

e ls e
*
p r in t

en

'
,

ba d '

die

e ls e

p r in t +

in

'

v a

l id d a t a

'

d e s c r i be t h c

( I)
(i i )
(M )
(i v )
(v )

pr o d u c e d i t

o u tpu t

n lark

95

m ar

45

m ar

69

ark

55

m ar

15

R e w r ite the f o llo

in te ge r
n

10

D O lo o p

B
,

t l 1e n

Eq

k
I

read

go to
i
d
f
en
en

u s in

i f ( I Ie

i f(

in g p r o g r a m

th e n

10

dif

+
p r in [ k
.

Pa ge 2

Scanned by CamScanner

f 13

DC P 20 5 3 ( f O >n t A 1B
Pr o

Qu e s t i o

O bs e r v

4 (8

e t he

) Sc m

c r

u 2-

ks)

m a r

p r o g r a m b e lo

w
-

para m

i n te g e r fu
c

(n

e te r

h a r a c te r

1,
,

c 0 n tI

Su m

a, x

' n '

10 0

d o 10 0 I
r ead+

sum

s to p
en

i nt g f u n c t i o n
c

ha r a c te r

fun(

r,

p q
,

in te g e r p q
0

if(

'

Eq

'

do 1l o i
J1

110

con

fu n

Po r

ea c h o

(a )

en

dif

en

t in

the n

p q

n
ue

fu n (

' A '
,

en ts , sta te the v a l u e o

4 5 );
,

:X * HE:3Lg y
T

(d )

su m

f u n ( ' % ' , 10 0 15 0
,

Pa ge 5

Scanned by CamScanner

f th e f o l l o w i n g s t a t e m

Su m

f 13

f t he

5 1 m

D C P 2 0 53 (f i
} i t-

Qu es tio n

5 (4

IB -

1u )

m a r

O bs e r v e the
pr ognun b e l o
is u m

S ta t e tb e

0
d o 10 0 I = 1 10
i s u m - is u t r 1 + i f
a c t( I
w i n t * i fa c t ( I )
c o n t in u e

10 0

o u

tw

p r in t +

'

Su m

'

i su m

f u n c t i o n i f a c t (n )
ifa c t - 1
d o 10 0 I
ifac t
10 0

ifa c t j

c o n tin ue
en

Q u e s t i o n 6 (5

m a r

ks)

O bs e r v e t he p r o g r a m be l o w C o n
c ha r a c t e r

v e r t th e

pr o gr a m

u s in

key

p a r a m e te r ( n
d o 100 I
1

r ead

10

ke y

if( ke y

Eq

) t he n

y o u pr es se d r
pr in t
k e y Eq T ) t he n
e lse I
'

y o u p r es se d y
p r in t
'

e lse

i f( k e y

p r in t

e lse

Eq
'

i f il k e y

yo u
Eq

'

K'

) t he n

pr es se d
'

L'

K'

) th e n

'
Yo u p r e s s e d L
p r in t
'
'
e l s e i f ( k e y E q M ) t he n
'
'

y o u pr e s s e d M
p r in t
'

e lse

p r in t
e n dif

10 0

'

*
,

n e i t he r

I J K L
,

nor

c o n t in u e

P R n f 1

Scanned by CamScanner

'

a su

br o u t i n e

f 1w

A1a e r

k B 9 68
vc

m a r la

t he f o i W W

"

: 1u a 1+ e t x f
ir T g j d l
do 10 I
1

f
35

Ej

1{ij
l

c o mu + L
w r it

( 6 3 ) ) ( x ( 1) I

20

f n

n a t(

E )

X2i i 3y

(a ) D e s c r i b e t he -

( b ) M o d y t he

a bo v e

a r

l in i

: o pr -

pr -

f c Baz g w

(: )
3 5 34

33 32

31

3 0 29

28 27

26

2 5 24

2 3 22

21

2 ]0 19

1 8 17

16

10

(H)

Scanned by CamScanner

i i c s I)

17 1

16 6

1 l

15 6

15 1

14 6

14 1

13 6

13 1

12 6

96

91

86

8]

76

71

66

61

56

51

46

41

36

31

26

21

16

11

e1 -

1 -

'

D C P 2 0 5 3 ( FO RT R A N Pr o gr a u

<M R T m -

Qu es tio n
W r i te

1 0 (2 0

o n

m a r

i g

u 11 n

) S c Bn e s rc r u

lY

2 0 0 8/ 0 9

T W

ks)

p r o g r a m t h a t r e a d s p o l l u t i o n i n d i c e s f o r 3 0 d a y s o f o b s e r v a t i o n s ( 10 r e a d i n g s p e r
da y ) fr o m a n in p u t Dle " PO L L U T E T X T
t he n c a l c u l a te s a n d d i s p l a y s bo t h m e a n a n d
s ta n d a r d v a r i a t i o n f o r e a c h d a
y o f t h e o bs e r v a t i o n s Y o u m a y u s e f u n c t i o n s o r s u b r o u t in e s
a

"

t o c a l c u l a t e th e

Ex

am

ple

m ean s an

s ta n

dar d

v a r ia t io n s

f t h e i n p u t f i l e PO L L U T E T X T

D ay

p o l l u t i o n in de x

( 10

r e a d in

gs pe r day )

10 0 10 2 10 5 9 8 8 7 7 0 5 5 40 4 0 4 0
2

1 0 1 1 10 14 0 14 5 10 1 1 0 0 1 10 10 0 9 5 9 9

1 10 1 10 12 0 12 5 12 5 14 5 16 0 17 0 17 8 170

2 0 3 0 4 0 3 0 2 0 5 6 7 0 80 9 0 1 0 0

30

Fo r m

u la :

ean

(x i ) /

Scanned by CamScanner

S ta n d a r d d e v i a t i o r

sqr t

( ( xi

m ean

2
) /

r
D C P 2 0 1 3 ( 1O RT ITA N I Bt o w u

Q 11e s l l o l 1 12 (2 0

m n lBr *

111i Br l (s

) Sc 11l c 1 lc r t 2 0 0 8/ 09

)
be r i n

s m a lle s t n u m

W r i te

t \ 1t w t i o r 1 t h a t i d e n t i t i e s t h e

(b ) W r i te

D r n c l i o n t 1l a t i d e n t i f i e s t h e b i g g e s t

(a )

nu m

be r i n

a se t o

a se t o

f M i n te ge r s

f M in t e ge r s

"
i n p u t D1e F 1L E I N T X T
f
p r o g r a m t ha t r e a d s N s e t 8 o f M i n t e g e r s r o m a n
f h i te e r s
1 h e n i d o n t l w b o t h t he s m a l l e s t a n { < t h c b i g g e s t n u m b e r s fb r e a c h s e t o t e n g
b y u s i n g t l w a b o v c hl n c t i o l l s i n (a ) a n d (b )
"

W r ite

(c )
'

il

'

Rx

a i +1p l o o

t d a t a i n l hc i n p u t f i l e

3 4 6 7 5 3 12 4

4 5 6 7 2 34 10

Scanned by CamScanner

FIL E IN T X T

15 7 82 4 5 12
2

"

"

You might also like