DECLARE FUNCTION AREA (L,B,H) CLS INPUT "ENTER LENGTH";L INPUT "ENTER BREADTH";B INPUT "ENTER HEIGHT";H PRINT "AREA OF BOX=";AREA (L,B,H) END FUNCTION AREA (L,B,H) A=2*(L*B+B*H+L*H) AREA = A END FUNCTION
DECLARE FUNCTION COUNT (S$) CLS INPUT "ENTER ANY STRING"; S$ PRINT "TOTAL NO. OF WORDS= "; COUNT(S$) END FUNCTION COUNT (S$) C = 1 FOR I = 1 TO LEN(S$) B$ = MID$(S$, I, 1) IF B$ = " " THEN C=C+ 1 END IF NEXT I COUNT = C END FUNCTION
DECLARE FUNCTION PERFECT (S) CLS INPUT "ENTER ANY NUMBER"; N S = SQR(N) P = PERFECT (S) IF P = S THEN PRINT "PERFECT SQUARE" ELSE PRINT "NOT PERFECT SQUARE" END IF END FUNCTION PERFECT (S) PERFECT = INT (S) END FUNCTION
DECLARE FUNCTION DISP$(S$) CLS INPUT "ENTER ANY STRING";S$ PRINT "WORD AFTER ERASING VOWELS";DISP$(S$) END FUNCTION DISP$(S$) FOR I =1 TO LEN(S$) B$=MID$(S$,I,1) C$=UCASE$(B$) IF C$="A" AND C$="E" AND C$="I" AND C$="O" AND C$="U" THEN D$=D$+B$ END IF NEXT I DISP$=D$ END FUNCTION
DECLARE SUB CHECK(N) CLS INPUT "ENTER ANY NUMBER";N CALL CHECK(N) END SUB CHECK(N) IF N MOD 13 = 0 THEN PRINT "THE GIVEN NO IS DIVISIBLE BY 13" ELSE PRINT "THE GIVEN NO IS NOT DIVISIBLE BY 13" END IF END SUB
DECLARE FUNCTION AREA (L,B,H) CLS INPUT "ENTER LENGTH";L INPUT "ENTER BREADTH";B INPUT "ENTER HEIGHT";H PRINT "AREA OF 4 WALLS=";AREA9L,B,H) END FUNCTION AREA (L,B,H) A= 2*H*(L+B) AREA=A END FUNCTION
DECLARE SUB CHECK(N$) CLS INPUT "ENTER ANY STRING";N$ CALL CHECK(N$) END SUB CHECK(N$) IF N$>0 THEN PRINT "THE GIVEN NUMBER IS POSITIVE" ELSEIF N$<0 THEN PRINT "THE GIVEN NUMBER IS NEGATIVE" ELSE PRINT "THE GIVEN NUMBER IS NEUTRAL" END IF END SUB
DECLARE FUNCTION CHECK$(S$) CLS INPUT "ENTER A CHARACTER";S$ PRINT "THE GIVEN CHARACTER IS ";CHECK$(S$) END FUNCTION CHECK$(S$) A=ASC(S$) IF A>=65 AND A<=91 THEN CHECK$="CAPITAL" ELSEIF A>=97 AND A<=122 THEN CHECK$="SMALL" END IF END FUNCTION
DECLARE FUNCTION PAL$(N$) CLS INPUT "ENTER STRING";N$ P$=PAL$(N$) IF N$=P$ THEN PRINT "THE STRING IS PALINDROME" ELSE PRINT "THE STRING IS NOT PALINDROME" END IF END FUNCTION PAL$(N$) FOR I = LEN(N$) TO 1 STEP -1 B$= MID$(N$,I,1) C$=C$+B$ NEXT I PAL$=C$ END FUNCTION
DECLARE SUB CHECK(N) CLS INPUT "ENTER ANY NUMBER";N CALL CHECK(N) END FUNCTION CHECK(N) C=0 FOR I=1 TO N IF N MOD I =0 THEN C=C+1 NEXT I IF C=2 THEN PRINT "THE GIVEN NO IS PRIME" ELSE PRINT "THE GIVEN NO IS COMPOSITE" END IF END SUB
DECLARE FUNCTION FACT(N) CLS INPUT "ENTER ANY NUMBER";N PRINT "FACTORIAL=";FACT(N) END FUNCTION FACT(N) F=1 FOR I= 1 TO N F=F*I NEXT I FACT=F END FUNCTION
DECLARE SUB CHECK(N) CLS INPUT "ENTER THE NUMBER";N CALL CHECK(N) END SUB CHECK(N) IF N>0 THEN PRINT "THE GIVEN NO IS POSITIVE" ELSE PRINT "THE GIVEN NO IS NEGATIVE" END IF END SUB
DECLARE SUB DISP(S$) CLS INPUT "ENTER A WORD";S$ CALL DISP(S$) END SUB DISP(S$) FOR I =1 TO LEN(S$) B$= MID (S$,I,1) C$= UCASE$(B$) IF C$="A" OR C$="E" OR C$="I" OR C$="O" OR C$="U" THEN PRINT B$ END IF NEXT I END SUB
DECLARE FUNCTION VOL (L,B,H) CLS INPUT "ENTER LENGTH";L INPUT "ENTER BREADTH";B INPUT "ENTER HEIGHT";H PRINT "VOLUME OF BOX=";VOL (L,B,H) END FUNCTION VOL (L,B,H) V=L*B*H VOL=V END FUNCTION
DECLARE SUB CHECK(A,B,C) CLS INPUT "ENTER ANY 3 NO";A,B,C CALL CHECK (A,B,C) END SUB CHECK (A,B,C) IF A>B AND A>C THEN PRINT "THE GREATEST NO IS";A ELSEIF B>A AND B>C THEN PRINT "THE GREATEST NO IS";B ELSE PRINT THE GREATEST NO IS";C END IF END SUB
DECLARE FUNCTION SI(P,T,R) CLS INPUT "ENTER THE PRINCIPLE";P INPUT "ENTER THE TIME";T INPUT "ENTER THE RATE";R PRINT "SIMPLE INTEREST";SI(P,T,R) END FUNCTION SI(P,T,R) S=P*T*R SI= S END FUNCTION
DECLARE FUNCTION CONVERT(C) CLS INPUT "ENTER CELCIUS" ;C PRINT "CELCIUS TO FARENHEIT";CONVERT (C) END FUNCTION CONVERT(C) F=9*C/5+32 CONVERT=F END FUNCTION