Site icon Pathshala Nepal

Study the following program and answer the given question.

Q BAISC OS
Online Calculator

Study the following program and answer the given question:

DECLARE FUNCTION diff (A,B)
CLS
INPUT"ENTER FIRST NUMBER;";A
INPUT"ENTER SECOND NUMBER;";B
PRINT"THE DIFFERENCE OF THE TWO NUMBERS=";diff (A,B)
END
FUNCTION diff (A,B)
END
FUNCTION diff(A,B)
D = A - B
DIFF = D
END FUNCTION

  1. What will be the output of the program if the user inputs 200 as the first number and 100 as the second number?
  2. Will the program run if the first line is (i.e. DECLARE....) is deleted?

1 Answer


1.

The output is: "The difference of the two numbers = 100"

2.

Yes, the program will run.

Topics from Computer
Related Questions