KnowledgeBoat Logo

Computer Studies

Draw a flowchart and write a program in QBASIC to enter the numerator and denominator of a fraction. Check and print whether the fraction is proper or improper. The program will also display the difference between the numerator and the denominator accordingly.

QBASIC: Conditional Statements

29 Likes

Answer

Flowchart

Draw a flowchart and write a program in QBASIC to enter the numerator and denominator of a fraction. Check and print whether the fraction is proper or improper. The program will also display the difference between the numerator and the denominator accordingly. Class 7 ICSE Understanding Computer Studies

QBASIC Program

Cls
Input "ENTER NUMERATOR"; N
Input "ENTER DENOMINATOR"; D
Let DIFF = 0
If N > D Then
    Print "IMPROPER FRACTION"
    Let DIFF = N - D
Else
    Print "PROPER FRACTION"
    DIFF = D - N
End If
Print "DIFFERENCE = "; DIFF
End

Output

ENTER NUMERATOR? 15
ENTER DENOMINATOR? 10
IMPROPER FRACTION
DIFFERENCE = 5

Answered By

12 Likes


Related Questions