forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Output Window Closes after running
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
erfejm



Joined: 25 Sep 2016
Posts: 7

PostPosted: Sun Oct 02, 2016 1:39 am    Post subject: Reply with quote

There seems to be an exception though, whenever I run an .exe file that ask the user if they want to use the program again, the program runs normally.
Code:

Program Fibonacci
Integer :: n, m
11 Print*, "Please input a number"
Read*, n
m = 0
o = 1
print*, o
z = n-1
Do i=1, z
  t = m + o
 
  m = o
  o = t
  print*, t
End do 
write (*,*) 'Program has finished; prompt to exit'
12 Print*, "Do you want to use the program again? enter 1 for yes and 2 for no"
Read*, ans
!If user input values other than 1 and 2 then input error
If (ans > 2 .or. ans < 0 ) Then
    Print*, "Error"
     GoTO 12
!Else send then back to the start
Else If (ans == 1) then
  Go TO 11
Else
  Print*, "Thank you for using my program!! :)"
End if
End program Fibonacci
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group