Forte, 49 60 bytes
3LET5=5+(0*4) 4INPUT0:LET6=6-(0*4) 5PRINT0:LET3=3+(0*4) 6END Forte is a weird and wonderful language with BASIC-like syntax and an execution model based on redefining integers. It has no conditional or looping constructs; to get conditional or looping behavior, you have to redefine the line numbers your program uses.
How?
Here's the code with better spacing:
3 LET 5=5+(0*4) 4 INPUT 0 : LET 6=6-(0*4) 5 PRINT 0 : LET 3=3+(0*4) 6 END If the user inputs a zero to this program, the three LET statements don't change anything, and the program boils down to PRINT 0 : END.
If the user inputs a one... it gets interesting.
3 LET 5=5+(0*4) The first time around, no numbers have been redefined yet; this line calculates 5+(0*4) and assigns that to 5. Nothing changes.
4 INPUT 0 : LET 6=6-(0*4) INPUT 0 reads a number from the user and redefines 0 as that number. Suppose the user enters a 1. Every time 0, or a value of zero, occurs from now on, it will be changed to 1. For instance: LET 6=6-(0*4) now is calculated as LET 6=6-(1*4), which redefines 6 to be 2. This changes the END statement's line number to 2, which moves it out of the way of the program, allowing an infinite loop.
Redefinitions: 0->1; 6->2
5 PRINT 0 : LET 3=3+(0*4) First, this line prints 1 (the value that 0 now represents). Then, 0*4 is now 1*4, so we have LET 3=7.
Redefinitions: 0->1; 6->2; 3->7
Next, we increment the instruction pointer and execute the command on line 3 7:
3 LET 5=5+(0*4) which redefines 5 to be 5+4...
Redefinitions: 0->1; 6->2; 3->7; 5->9
... and we execute line 5 9:
5 PRINT 0 : LET 3=3+(0*4) which should be read (with substitutions) as 9 PRINT 1 : LET 7=7+(1*4). We print another 1 and change 7 to 11, which means we execute the original line 3 again, and so forth.
For those who are still confused, read the Esolangs article or ping ais523ais523 (the language's inventor!) in chat.