Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Input

Status
Not open for further replies.

Ninwa

Programmer
Joined
Dec 2, 2001
Messages
2
Location
US
I'm sort of new to QBasic and these forums but was wondering if anyone of you could help me out...
I just started with qbasic but want to make a simple app, how would I make it so that qbasic would check if the inputed number is greater or less than the one it is looking for, EX:
INPUT "What is your name?"; username$
PRINT "Hello, "; username$; "."
INPUT "How old are you?"; age$
LET myage = 24
PRINT "Ahh, you are only "; agedifference$ " years older than me."


I barely know what I did in those 2 last lines but if you understand where I am getting at, I'd appreciate your help...

I have AIM if you prefer to explain it through there, screen name is Ninwa56.

Thanks in advance... :)

 
this is easy to do. First the input age should be a variable, not a string so try this:

INPUT "How old are you?" age
agedifference = age - myage
PRINT "Ahh...You are only",agedifference,"years older than
me."

I was going to IM this to you, but you weren't online.
 
Ohh lol well thanks, and sorry for not being online, I was online all day yesterday tho after I posted, anyways thanks a lot...
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top