QBASIC Program To Find The Product Of Two Numbers

 QBASIC Program To Find The Product Of Two Numbers

QBASIC Program To Find The Product Of Two Numbers

Algorithm To Find The Product of Two Numbers


Step1: Start
Step2: Accept/Input any two numbers and store them in two different variables a and b
Step3: Calculate product = a * b
Step4: Display the product
Step5: End the program

QBASIC Program To Find The Product Of Two Numbers

CLS
INPUT" Enter first number"; a
INPUT" Enter second number"; b
Product=a*b
PRINT" The product is "; Product
END

Algorithm To Find The Product of Two Numbers Using Sub Procedure in QBASIC

Step1: Start
Step2: Declare the sub procedure with a name and parameters as Product (a, b)
Step3: Input two numbers a and b
Step4: Call the sub procedure declared in the step2 with CALL statement as CALL Product (a, b)
Step5: End the program
Step6: Define the sub procedure
Step7: In the sub procedure, calculate the Product
Step8: Display the Product
Step9: End the sub procedure

QBASIC Program To Find The Product Of Two Numbers Using SUB Procedure

DECLARE SUB Product(a, b)
CLS
INPUT" Enter first number"; a
INPUT" Enter second number"; b
CALL Product(a, b)
END
SUB Product(a, b)
P=a*b
PRINT" The product is "; P
END SUB

Algorithm To Find The Product Of Two Numbers Using Function Procedure in QBASIC

Step1: Start
Step2: Declare the function procedure with name and parameters as Product (a, b)
Step3: Input two numbers a and b
Step4: Call the function procedure declared in the step2 with a variable or PRINT Statement
Step5: End the program
Step6: Define the function procedure
Step7: In the function procedure, calculate the product
Step8: Assign the value of product to the function name
Step9: End the function procedure

QBASIC Program To Find The Product Of Two Numbers Using FUNCTION Procedure

DECLARE FUNCTION Product(a, b)
CLS
INPUT" Enter first number"; a
INPUT" Enter second number"; b
PRINT" The product is"; Product(a, b)
END
FUNCTION Product(a, b)
P=a*b
Product=P
END FUNCTION





Comments