io - User input after print -
i'm trying make simple lua program converts fahrenheit celsius , kelvin , don't know how put input command on same line print line. here's mean.
i want program display:
fahrenheit = "here's user input" i know how make say
fahrenheit = "user input" i'm still novice.
this code far:
print("fahrenheit = ") f = io.read() c = (5/9)*(f-32) print("celsius = "..c) k = c + 273 print("kelvin = "..k)
look io.write() , io.read(). instance, say:
io.write("fahrenheit = ") the write command writes output screen buffer, doesn't add newline. similarly, read checks latest input, , returns it.
for reference, suggest this link tutorial.
Comments
Post a Comment