Jump to content
  • Advertisement
Sign in to follow this  
Johanna

g95-error: unclassifiable statement

This topic is 3416 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I wanted to compile following easy program:
program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
    rest = MOD(kandidat, teiler)
    if (rest == 0) THEN
        write(*,*)kandidat, ' ist nicht Teiler'
                  teiler, 'ist ein Teiler'
        stop
    end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim   
It is about testing if a number is a prime number or not. The following error appeared: Error: Unclassifiable statement at (1) What is wrong? Why is "teiler" not classifiable, even though I write: teiler=2? I would be very happy if anybody could help me. Thanks a lot and best wishes from Germany, Theresa [By the way, please use [code][/code] (short samples) or [source][/source] (long samples) tags as appropriate to post code. That way, indentation will be preserved.] [Edited by - Zahlman on May 19, 2009 11:21:48 AM]

Share this post


Link to post
Share on other sites
Advertisement
It would help to say what language you're using, rather than just what compiler. I had to look that up to figure out that it's Fortran. Very few people use Fortran these days outside of university researchers :)

Share this post


Link to post
Share on other sites
Yay, Fortran! ♥

Looks to me like your line continuation in the write statement isn't correct. Try adding , & after the ' ist nicht Teiler' and before the newline, like so:


program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler', &
teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!