Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > Fortran 90 Programming with NR

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2007, 08:57 AM
Feynman Feynman is offline
Registered User
 
Join Date: Jun 2007
Posts: 9
problem with goto

I write a program to beter see the comand goto;
It is a program read a number X , till X is less than 0 then it is invalid, so where is the problem in my code? where is the error?

code:
program GO TO
implicit none
10 print*,'entrer la valeur de X'
read* ,X
IF(X.LT. 0) then
print*,'INvalide'
GO TO 10
else
print*,'valide'
END IF
END
Reply With Quote
  #2  
Old 07-27-2008, 12:27 PM
Skif Skif is offline
Registered User
 
Join Date: Jul 2008
Posts: 8
problem with goto

Yuo must change the name of program
you as used "Implicic none" then all variable must be declared

for exemple

program pippo
implicit none
real*8 X
10 print*,'entrer la valeur de X'
read(*,*) X
IF(X.LT. 0) then
print*,'INvalide'
GO TO 10
else
print*,'valide'
END IF
END

hi!!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.