Computer Science, asked by pranil777, 1 year ago

write a program in qbasic to enter two numbers . Substract the second number from the first number , if the first number is greater than second number​

Answers

Answered by muthyalasravani1729
0

Answer:

click on the photo to get full answer

Attachments:
Answered by AskewTronics
0

Program In Q-Basic :

Explanation:

INPUT "Enter the first number",First_number 'Take the input from the user for first value

INPUT "Enter the second number",Second_number 'take the input from the user for the second value

IF First_number>Second_number THEN 'Check the condition

PRINT First_number-Second_number 'print If second number is smaller.

ELSE

PRINT "The first number is not greator, The second number is greator"

END IF

Output :

  • If the user input as 4 and 3, then the output is 1.

Code Explanation:

  • The above code is written in Q-basic, in which the first and the second line is used to take the input as two number.
  • Then the if condition checks that the second number is smaller or not.
  • If smaller print the difference otherwise print the error message.

Learn More ;

  • Q-Basic : https://brainly.in/question/14372279
Similar questions