i have an exam and i have done this program. but Force tells me that something is wrong with DO?? can you tell me why please? this is the program i made:
PROGRAM KOLOKVIJ
DIMENSION M(10), K(10)
OPEN(5,FILE='ULAZ.TXT')
OPEN(6,FILE='IZLAZ.TXT')
READ(5,*)N
READ(5,*)(M(I),I=1,N)
NNBR=0
DO 15 I=2,N,2
IF(M(I)/2*2.EQ.M(I))THEN
NNBR=NNBR+1
K(NNBR)=M(I)
ENDIF
15 CONTINUE
WRITE(6,100)(M(I),I=1,N)
WRITE(6,200)(K(I),I=1,N)
100 FORMAT('POLJE M=',10F6.2)
200 FORMAT('POLJE K=',10F6.2)
KPROD=1
DO 16 I=1,N,1
KPROD=KPROD*K(I)
16 CONTINUE
WRITE(6,300)KPROD
300 FORMAT('PRODUKT POLJA K=',I6)
CLOSE(5)
CLOSE(6)
END
thanks
PROGRAM KOLOKVIJ
DIMENSION M(10), K(10)
OPEN(5,FILE='ULAZ.TXT')
OPEN(6,FILE='IZLAZ.TXT')
READ(5,*)N
READ(5,*)(M(I),I=1,N)
NNBR=0
DO 15 I=2,N,2
IF(M(I)/2*2.EQ.M(I))THEN
NNBR=NNBR+1
K(NNBR)=M(I)
ENDIF
15 CONTINUE
WRITE(6,100)(M(I),I=1,N)
WRITE(6,200)(K(I),I=1,N)
100 FORMAT('POLJE M=',10F6.2)
200 FORMAT('POLJE K=',10F6.2)
KPROD=1
DO 16 I=1,N,1
KPROD=KPROD*K(I)
16 CONTINUE
WRITE(6,300)KPROD
300 FORMAT('PRODUKT POLJA K=',I6)
CLOSE(5)
CLOSE(6)
END
thanks