DECLARE SUB SUM(N) CLS INPUT "ENTER ANY NUMBER";N CALL SUB(N) END SUB NUM(N) S=0 WHILE N<>0 R= N MOD 10 S=S+R N=N\10 WEND PRINT"SUM OF DIGITS";S END SUB
DECLARE FUNCTION COUNT(N$) CLS INPUT "ENTER ANY STRING";(N$) PRINT "TOTAL NO OF CONSONANT"; COUNT(N$) END FUNCTION COUNT(N$) FOR I= 1 TO LEN(N$) B$= MID$(N$,I,1) C$ = UCASE$(B$) IF C$<>"A" AND C$<>"E" AND C$<>"I" AND C$<>"O" AND C$<>"U" THEN C=C+1 NEXT I COUNT=C END FUNCTION
DECLARE FUNCTION VOL(R,H) CLS INPUT "ENTER RADIUS";R INPUT "ENTER HEIGHT";H PRINT "THE VOLUME OF CYLINDER";VOL(R,H) END FUNCTION VOL(R,H) V=22/7*R^2*H VOL=V END FUNCTION
DECLARE FUNCTION AREA (B,H) CLS INPUT "ENTER BREADTH";B INPUT "ENTER HEIGHT";H PRINT "AREA OF TRIANGLE";AREA(B,H) END FUNCTION AREA (B,H) A=1/2 *B*H AREA =A END FUNCTON
DECLARE SUB REV$(S$) CLS INPUT "ENTER A STRING ";S$ CALL REV(S$) END SUB REV$(S$) FOR I=LEN(N$) TO 1 STEP -1 B$=MID$(N$,I,1) C$=C$+B$ NEXT I REV$=C$ END SUB
DECLARE FUNCTION COUNT(N$) CLS INPUT "ENTER ANY STRING";N$ PRINT "TOTAL NO OF VOWELS";COUNT(N$) END FUNCTION COUNT(N$) FOR I = 1 TO LEN(N$) B$ =MID$(N$,I,1) C$=UCASE$(B$) IF C$="A" OR C$="E" OR C$="I" OR C$="O" OR C$="U" THEN C=C+1 NEXT I COUNT=C END FUNCTION
DECLARE SUB AREA (L,B,H) CLS INPUT "ENTER LENGTH";L INPUT "ENTER BREADTH";B INPUT "ENTER HEIGHT";H CALL AREA (L,B,H) END SUB AREA (L,B,H) A= 2*H*(L+B) PRINT "AREA OF 4 WALLS";A END SUB
DELCARE SUB COUNT(N$) CLS INPUT "ENTER ANY STRING";N$ CALL COUNT$ END SUB COUNT$ FOR I= 1 TO LEN$(N$) B$=MID$(N$,I,1) C$=UCASE$(B$) IF C$="A" OR C$="E" OR C$="I" OR C$="O" OR C$="U" THEN C= C+1 NEXT I PRINT "TOTAL NO OF VOWELS";C END FUNCTION
DECLARE FUNCTION AVG(A,B,C) CLS INPUT "ENTER ANY 3 NUMBER";A,B,C PRINT "AVERAGE OF 3 NO=";AVG(A,B,C) END FUNCTION AVG(A,B,C) AV=(A+B+C)/3 AVG=AV END FUNCTION