Beruflich Dokumente
Kultur Dokumente
a) REAL INCOME(2007:2013,12)
b) REAL A(6,12)
c) REAL INCOME(12:2007,12:2013)
d) REAL INCOME(7,12,2013:2007)
e) REAL INCOME(12,6)
a) 1 2
2 1
2 4 6
b) 1 2
1 2
2 5 7
c) 1 2
3 4
2 4 5
d)1 1
2 2
6 42
e) 1 2
1 2
2 4 5
integer ax,by
data ax, by, i /1, 2, 3/
ax = ax + by
i = i + ax
if ( ax > by ) goto (1, 2, 1, 2, 1, 2),i
stop
print*, ax, by, i
goto 1
end
DIMENSION ARRAY(2)
DATA ARRAY /12345,67890/
a) a compilation error
b) a two dimensional real array of 2 elements
c) a two dimensional array of 12345 x 67890 elements
d) a three dimensional real array
e) a one dimensional real array of 2 elements
9) What is the output of the following program?
a)No output b) 3 2 6
c) 1 1 2
113
d) 2 2 1
331
e) 2 2 2
333
a) character address_information(100)
b) integer n(2:2,3:4)
c) integer parameter k=5; character a(k)
d) logical (true,false)
e) Real a(1,1,1)
a) 0 1 2
b) 1 2 3
c) 3 4 5
d) 2 3 4
e) 1 2 3
123
234
234
345
234
234
345
123
123
012
38.0
38.0
38.0
3.0
38
10) How many lines of output will the statements print?
5
a) Error
format ( 2 ( i5 / i4/ i3 ) )
m = 5
do k = 1, 5, 2
write (*,5) m , k, k+1
enddo
end
b) 3
c) 9
d) 10
e) 12
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
11) What is the output of the following code?
integer x,y,z
x = 2.2; y = 3.3; z = 4.6
if ( x .EQ. y ) then
if ( y .EQ. 3 ) then
z = z + 1
else
z = z + 2
end if
else
if ( y /= 3) z = z + 3
end if
print*, z
end
a)
b) No output
c) 4
integer a(8)
data (a(i),i = 1, 8)/5, 3, 2, 1, 7, 2, 4, 1/
call sub1 ( a , 5 )
print*, a
end
d) 6
e) 5
a) a compilation error
c) an array of 16 real numbers
d) an array of 125 real numbers
e) a one dimensional array containing 1.0, 5.0, 5.0, 5.0 initially
b) 3 4
4 7
c) 7
7 7
a) 7 5 4 3 2 2 1 1
b) 7 5 3 2 1 2 4 1
c) 1 2 3 5 7 2 4 1
d) 1 4 2 7 1 2 3 5
e) 7 5 4 3 2 2 1 1
17) What
k = 7
m = 3
i = ifun (m)
print*, i , k
end
a) 3 7
3
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
16) What is the output of the program below?
d) 7 7
7
e) 3
3 3
(1)
(2)
(3)
(4)
(5)
a) (5)
X = SQTR(25.0)
X = SUM(T,Y,SIZE,15)
X = SQRT(25.0)
X = CUBEROOT(A)
d) (2)
e) (1)
a) 5
7
6
integer t
t = 5.0
print*, t
i = kfun ( t )
print*, i
end
a) C24P
b) C3FP
c) CENG200FortranProgramming
d) CENG3H200FortranProgramming
e) CENG 200 Fortran Programming
b) 5.0
c) 5.0
7
6
5
6
d) 6
e) 5.0
5
6
7.0
6.0
integer A(4,4)
do 55 i=1,4
do 55 j=1,4
55 A(i,j) = i*j
do 66 i=1,4
66 write(*,77) (A(i,j),j=1,i,1)
77 format(4(1x,i3))
end
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
a) 1 2 3 4 b) 1 2 3 4 c) 1
2 4 6 8
2 4 6
2 4
3 6 9 12
3 6
3 6 9
4 8 12 16
4
4 8 12 16
d) 1
e) 1 2 3
2 4
2 4
3 6 9
3
real x,y
do x = 5.2 , 3.2 , -1.2
do y = 1.2 , 10.0 , 1.2
print*, x , y
end do
end do
end
b) 144
c) 169
d) 16
e) 256
d) 1
1
0
e) 1
2
0
a) 7 2 4
725
726
b) 7 2 4
c) 2 1 2
313
212
313
d)2 1 2
313
222
323
e) 2 1 2
313
724
835
integer ARR(4,4)
data ARR / 1,5,9,13,2,6,10,14,3,7,11,15,4,8,12,16/
do 5 i = 1, 3
do j = 1, 3
it = ARR(i,j)
ARR(i,j) = ARR(j,i)
ARR(j,i) = it
end do
continue
do i = 1 , 3
print*, (ARR(i,j),j = 1,4)
end do
end
a) 1 2 3
5 6 7
9 10 11
13 14 15
c) 1, 2 and 3
d) 5
e) 4 and 5
e) 1 2.3 3.0
3 1.0
4.0
3 1.0
26) What are the values of the elements in array def, after the
execution?
23) What will be the content of the integer array ARR after the
execution of the code below?
b) 1
end
c) 2
2
2
function k()
do 5 i=1,1; print*,i
end do
k=i; return
b) 2
2
0
3.
a) 2 and 3
implicit none
integer i,j,k
j=1; do 5 i=2,1,-1
5 j=j+k()
print*,i; end
a) 1
1
-1
4.
5.
2.
a) 132
1.
4 b) 1 2 3 4 c) 1 2 3 d) 1 1 1 e) 1 2 3 4
8
5 6 7 8
4 5 6
2 2 2
1 2 3 4
12
9 10 11 12
7 8 9
3 3 3
1 2 3 4
16
10 11 12
4 4 4
a) 6 2 2
b) 6 4 2
c) 3 3 3
d) 1 1 1
a) 2242.00
b) 0.0 0.0 2.0 0.0
c) 20.0
20.0
d) 0.0 0.0 4.0 0.0
e) 2242 2242
e) 9 9 9
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
28) What is the content of array ARR after the execution?
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
32) What gets printed out by the following program?
character (len=7) :: a1,a2,a3,a4,a5
data i,j /20,15/
a1 = 3HAli
if (i/=j .and. j==0) then
a1 = 4HVeli; i=i/2
endif
a2 = 6HGelmis
if (i<j .or. j>=20) then
a2 = 6HGitmis
integer ARR( 9 )
data (ARR (i),i=9,1,-1) /9,8,7,6,5,4,3,2,1/
do i = 1,5
it = ARR (i)
ARR (i) = ARR (6-i)
ARR (6-i) = it
end do
print*, (ARR(i),i=1,9)
end
a) 9, 8, 7, 6, 5, 4, 3, 2, 1
b) 5, 6, 7, 8, 9, 4, 3, 2, 1
c) 9, 8, 7, 6, 5, 1, 2, 3, 4
d) 1, 2, 3, 4, 5, 6, 7, 8, 9
e) 5, 6, 7, 8, 9, 1, 2, 3, 4
29) What will be printed after the execution?
character *3 course (4)
data(course(i),i=1,4)/4HCENG,"200","4TRAN","PROGRAMLAMA"
/
print*, (course (i), i = 1, 4)
end
a) CENG3H20FortProg
b) CEN2004TRPRO
c) CENG
200
Fort
d) CENG
3H20 Fort
e) C24P
Progr
Prog
a) ABBCCC
DDDDCCCBBA
b) AAABBBCCC
DDDDCCCCBBBBAAAA
c) AABBCC
DDCCBBAA
d) ABC
DCBA
e) AABBCC
DD
31) What is the output of the code below?
real BX
integer M
Bx = 0.5
bX = 1.5
M = Bx - bX
m = bX - Bx
BX = (m + M) * ( bX - 5 / 3 )
print*, M, 5HAAAAA , BX
end
a) -1.0 AAAAA
b) 0 AAAAA
c) -1 AAAAA
d) 0 AAAAA
e) 0 5HAAAAA
0.0
0.0
0.0
0
0.0
DO N i=e1,e2,e3
Statements
CONTINUE
a) aaabbccccdddeeefffggggg
b) gggggfffeeedddcccceee
c) ggffeeddccee
d) abcdefg
e) gfedce
35) To give a name such as Area of a Triangle to a program,
which of the below has the valid syntax?
a) The first statement must be: PROGRAM Area of a Triangle
The last statement must be: END PROGRAM Area of a Triangle
b) The first statement must be: PROGRAM NAME : Area of a
Triangle
The last statement must be: END PROGRAM
c) The first statement must be: PROGRAM ID: Area_of_a_Triangle
The last statement must be: END ID
d) The first statement must be: PROGRAM Area_of_a_Triangle
The last statement must be: END PROGRAM Area_of_a_Triangle
e) The first statement must be : !!! Area of a Triangle
c) 2
d) 2
e) 2
a) ***
358
BB1000.00B-358.8
b) ***358BB1000.00
B-358.8
c) 358358BBB999.99
B-358.8
d) ***358
BB1000.00B-358
e) -358.06358BB999.999
B-358.06
39) What is the output of the following code?
integer a(11)
data n/11/
call sub(500,a,11)
print*,((a(i)), i = 1, 10)
end
subroutine sub(n,x,isize)
integer index, n, x(isize)
index2 = 1
do index = 2, n/2
if (mod(n,index).EQ. 0)then
x(index2)= index
index2 = index2 + 1
end if
end do
return
end
a) 1 2 3 5 8 13 21 34 55
b) 0 4 5 10 20 25 50 100 125
1
3
b)
c)
d)
e)
a)
89
250
integer x
data x, i /1, 2/
x = x * (-2)**2
if (x) 3, 2, 1
print*, x
goto (2, 3, 1), x
print*, x
stop
end
4
4
1
Infinitely many (4)s will be printed.
Infinitely many (1)s will be printed.
No output will be produced.