.                                                . How to use this forum              The QBasic Forum                                     

 Return to Index  

Getting Started: 1- COPYVAR lab problem

September 21 2004 at 5:30 PM
Solitaire  (Login Solitaire1)

Response to Projects and Lab Problems


Lab Problem - "COPYVAR"

CLS 'copy one variable to another
X = 5
Y = 8
PRINT "X ="; X; " Y ="; Y
X = Y 'X becomes 8
Y = X 'Y is still 8
PRINT "X ="; X; " Y ="; Y

Start with the above program and save it as COPYVAR. Now exchange the values of the variables so X will equal 8 and Y will equal 5 without reassigning literal values. Hint: You will need to use a third temporary variable. Name it temp. Save again. Post your program after you have solved the problem.

 Respond to this message   
 Copyright © 1999-2018 Network54. All rights reserved.   Terms of Use   Privacy Statement