7. Display square of an input number. REM PROGRAM TO DISPLAY SQUARE OF AN INPUT NUMBER CLS INPUT “ENTER ANY NUMBER”; N S = N ^ 2 PRINT “SQUARE OF NUMBER ”; S END USING SUB PROCEDURE DECLARE SUB SQUARE (N) CLS INPUT “ENTER ANY NUMBER”; N CALL SQUARE(N) END SUB SQUARE (N) S = N ^ 2 PRINT “SQUARE OF NUMBER “; S END SUB USING FUNCTION PROCEDURE DECLARE FUNCTION SQUARE (N) CLS INPUT “ENTER ANY NUMBER”; N S = SQUARE(N) PRINT “SQUARE OF NUMBER “; S END FUNCTION SQUARE (N) SQ= N ^ 2 SQUARE = SQ END FUNCTION 8. Display cube of an input number. REM PROGRAM TO DISPLAY CUBE OF AN INPUT NUMBER CLS INPUT “ENTER ANY NUMBER”; N C = N ^ 3 PRINT “CUBE OF NUMBER ”; C END USING SUB PROCEDURE DECLARE SUB CUBE (N) CLS INPUT “ENTER ANY NUMBER”; N CALL CUBE(N) END SUB CUBE (N) C = N ^ 3 PRINT “CUBE OF NUMBER “; C END SUB USING FUNCTION PROCEDURE DECLARE FUNCTION CUBE (N) CLS INP...
120. WAP to input any number and check whether the given no. is palindrome or not. CLS INPUT "ENTER ANY NUMBER"; N A = N S = 0 WHILE N < > 0 R = N MOD 10 S = S * 10 + R N = N \ 10 WEND IF A = S THEN PRINT A; "IS PALINDROME" ELSE PRINT A; "IS NOT PALINDROME" END IF END USING SUB PROCEDURE DECLARE SUB PALIN (N) CLS INPUT "ENTER ANY NUMBER"; N CALL PALIN (N) END SUB PALIN (N) A = N S = 0 WHILE N < > 0 R = N MOD 10 S = S * 10 + R N = N \ 10 WEND IF A = S THEN PRINT A; "IS PALINDROME" ELSE PRINT A; "IS NOT PALINDROME" END IF END SUB USING FUNCTION PROCEDURE DECLARE FUNCTION PALIN (N) CLS INPUT "ENTER ANY NUMBER"; N P = PALIN ((N)) IF P = N THEN PRINT N; "IS PALINDROME" ELSE PRINT N; "IS NOT PALINDROME" END IF END FUNCTION PALIN (N) S = 0 WHILE N < > 0 R = N MOD 10 ...
1. Enter any two numbers and display its sum. REM PROGRAM TO DISPLAY SUM OF TWO NUMBERS CLS INPUT “ENTER FIRST NUMBER”; A INPUT “ENTER SECOND NUMBER”; B S = A + B PRINT “SUM OF TWO NUMBERS”; S END USING SUB PROCEDURE DECLARE SUB SUM (A, B) CLS INPUT “ENTER FIRST NUMBER”; A INPUT “ENTER SECOND NUMBER”; B CALL SUM(A, B) END SUB SUM (A, B) S = A + B PRINT “SUM OF TWO NUMBERS”; S END SUB USING FUNCTION PROCEDURE DECLARE FUNCTION SUM (A, B) CLS INPUT “ENTER FIRST NUMBER”; A INPUT “ENTER SECOND NUMBER”; B S = SUM(A, B) PRINT “SUM OF TWO NUMBERS”; S END FUNCTION SUM (A, B) SU = A + B SUM = SU END FUNCTION 2. Enter any two numbers and display its difference. REM PROGRAM TO DISPLAY DIFFERENCE OF TWO NUMBERS CLS INPUT “ENTER FIRST NUMBER”; A INPUT “ENTER SECOND NUMBER”; B D = A - B PRINT “DIFFERENCE OF TWO NUMBERS”; D END USING SUB PROCEDURE DECLARE SUB DIFF (A, B) CLS INPUT “ENTER FIRST NUM...