Program for Swapping the variable values in QBASIC
For Numeric Value
CLS
INPUT "Enter Value of A & B"; a, b
PRINT "Value of A before swap";
PRINT "Value OF b before swap"; b
c = a
a = b
b = c
PRINT "Value of A after swap"; a
PRINT "Value of B after swap"; b
END





For Alphanumeric
CLS
INPUT "Enter Value of A & B"; a$, b$
PRINT "Value of A before swap"; a$
PRINT "Value OF b before swap"; b$
c$ = a$
a$ = b$
b$ = c$
PRINT "Value of A after swap"; a$
PRINT "Value of B after swap"; b$
END