write the program in Q Basic .
to input and interchange the value of two variables
Share
write the program in Q Basic .
to input and interchange the value of two variables
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Input"Enter 1st Number";a
Input"Enter 2nd Number";b
Let c = a+b;
Let a = c-a;
Let b= c-b;
Print"1st number";a
Print"2nd number";b
END
If this helps u then only mark as brainliest.
Below are the Q-Basic program and output for the above question:
Output :
If the user input as 3 and 4, then it will prints 4 and 3.
If the user input as 4 and 5, then it will prints 5 and 4.
Explanation:
INPUT "Enter the first number for swapping",first_number 'Take the first number from user.
INPUT "Enter the Second number for swapping",Second_number' Take the second number from user.
Third_Number=first_number'Swap the number using third variable.
first_number=Second_number
Second_number=Third_Number
PRINT "The number after Swapping is : ",first_number,"and ",Second_number'Print the number after swapping.
Code Explanation :
Learn More :