Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

siple program problem. please help!

Status
Not open for further replies.

gogx1990

Technical User
Jan 19, 2010
3
HR
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
 
I just wonder why students are studying old Fortran77? Why not Fortran95?

gogx1990: try to compile and run test case.
 
the problem is when i enter nubers in ULAZ.TXT
it tells me ---one or more CON code pages invalid for given keyboard code---

i dont know why they re teaching us this :S not logic
 
Berbas: Probably because the lecturers only know F77 and not F95. Anyway, Force is a Brazilian F77 IDE with an English/Portuguese interface so it won't do F95.

gogx1990: move label 15 out. The labels are from columns 1-5, 6 is continuation and 7-72 is code.
 
Yeah, funny... ...not.

I went through the same with a former boss. I spoke perfectly F90, but as he wanted to take my codes elsewhere, I was forced to learn F77 (which I didn't speak at the time) so he could understand them.

BTW: Maybe the label ended up at the wrong place for having some autotabs turned on in your editor.
 
ty everyone. My brother solved it somehow :)

regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top