answersLogoWhite

0


Best Answer

Create a form with two text boxes (txtNumber1, and txtNumber2) and a command button (cmdSwap).

Option Explicit

Dim numb1 As Variant

Dim numb2 As Variant

Private Sub cmdSwap_Click()

numb1 = txtNumber1.Text

numb2 = txtNumber2.Text

txtNumber2.Text = numb1

txtNumber1.Text = numb2

End Sub

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

MS-DOS QBasic Version 1.1

SWAP Exchanges the values of two variables.

SWAP variable1, variable2

variable1 and variable2 Two variables of the same data type.

Example:

a% = 1: b% = 2

PRINT "Before: "; a%, b%

SWAP a%, b%

PRINT "After: "; a%, b%

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

swap two value by visual basic

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you swap two numbers in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Do you need statement numbers in QBASIC?

Statement numbers were a feature of BASIC, and while QBASIC supports them, they are by no means necessary.


Swap of two numbers with xor?

void swap (int *a, int *b) { *a ^= *b; *b ^= *a; *a ^= *b; return; }


How to sort the sum of numbers in qbasic?

You use the relevant formula.


Write a program to swap two numbers using function?

swap (int *a, int *b) { *a ^= *b; *b ^= *a; *a ^= *b; }


How to swap two numbers by call by reference in c plus plus?

void swap(int& a, int& b ) { a^=b^=a^=b; }


What are the difference between gwbasic and qbasic?

Difference between QBASIC and GWBASIC?


Swap two numbers using call by value and call by reference?

You cannot swap two numbers using call by value, because the called function does not have access to the original copy of the numbers.Swap with call by reference... This routine uses exclusive or swap without temporary variable.void swap (int *a, int *b) {*a ^= *b;*b ^= *a;*a ^= *b;return;}


How do you write a javascript to swap two numbers without using third one?

By using the algorithm of bitwise EORing (Exclusive ORing) the numbers together:If the two numbers are X and Y, then to swap them:X = X EOR YY = Y EOR XX =X EOR Ywill swap them.With knowledge of that algorithm, one then uses the syntax of Javascript to implement it.


To print even nobetween 10 and 100 on qbasic command?

You need a code that can run to print even numbers between 10 and 100 using the qbasic command.


What is it called when you swap the two numbers that you multiply?

I don't know.the Switch-A-Roo? not,it's inverse.


What are the 2 types of data allowed in QBASIC?

the two types of data used in Qbasic is numeric data and alpha numeric data.


How do you sort numbers in ascending order in Qbasic?

Cls input"no. Of elements",n for i=1 to n input,a(i) next i for i=1 to n-1 for j=i+1 to n if a(i)>a(j) then swap a(i),a(j) next j next i for i=1 to n print, a(i) next i end