Qbasic Programming For Dummies Pdf [extra Quality] -

CLS INPUT "Please enter your age: ", age IF age >= 18 THEN PRINT "You are an adult." ELSE PRINT "You are a minor." END IF END Use code with caution. Loops: Repeating Actions

CLS FOR i = 1 TO 10 PRINT "This is repetition number"; i NEXT i END Use code with caution. The DO...LOOP (Conditional Loop) qbasic programming for dummies pdf

| Command | What it does | Example | |---------|--------------|---------| | CLS | Clears screen | CLS | | INPUT | Asks user for data | INPUT "Name"; n$ | | PRINT | Shows output | PRINT "Hi" | | IF | Decision | IF x>0 THEN PRINT "Positive" | | FOR | Loop counter | FOR i=1 TO 5 | | DO...LOOP | Conditional loop | DO UNTIL x=10 | | RND | Random number | INT(RND*10)+1 | | GOTO | Jump (use rarely!) | GOTO start | CLS INPUT "Please enter your age: ", age

Back to top