Professional Documents
Culture Documents
Ms 15
Ms 15
Ms 15
1. [6 Marks] Find the mistakes in the following Fortran 90 program. By making minimal
changes to the program, print out the values of i from 1 to 5.
program wrong
i m p l i c i t none
integer : : i , integer
i n t e g e r , parameter : : v a l u e
do v a l u e = 1 , i
p r i n t , ' The v a l u e = ' , i
end do
stop
end program wrong
hq
2. [3 Marks] Write Fortran 90 statement for the expression: exp [ 2(x m)2 .
i
1
2
5. [6 Marks] Write a Fortran 90 program to compute Kronecker delta i,j , for given values
of i and j . The program should read two integers i and j and print 0 if they are unequal,
and 1 if they are equal.
6. [8 Marks] Write a Fortran 90 program to calculate the square root of a number using
Newton's method. Use the program to calculate the square root of 36 with a starting
value x0 = 5. Calculate only up to x4 .