DECLARE FUNCTION COUNT (N$)
CLS
INPUT "ENTER ANY WORD ";N$
PRINT "TOTAL NO OF CONSONENT =";COUNT (N$)
END
FUNCTION COUNT (N$)
C=0
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$ < >"O" C$ < >"U" THEN C = C + 1
NEXT I
PRINT "TOTAL NO OF CONSONENT";C
END SUB
Friday, October 25, 2019
#10 PRINT FIRST TEN ODD NUMBERS
DECLARE SUB SERIES ( )
CLS
CALL SERIES ( )
END
SUB SERIES ( )
A=1
FOR I = 1 TO 10
PRINT A
A = A + 2
NEXT I
END SUB
CLS
CALL SERIES ( )
END
SUB SERIES ( )
A=1
FOR I = 1 TO 10
PRINT A
A = A + 2
NEXT I
END SUB
#9 VOLUME OF CYLINDER
DECLARE FUNCTION VOL (R,H)
CLS
INPUT "ENTER RADIUS";R
INPUT "ENTER HEIGHT";H
PRINT "VOL OF CYLINDER=";VOL (R,H)
END
FUNCTION VOL (R,H)
V= 22 / 7 * R ^ 2 * H
VOL=V
END FUNCTION
CLS
INPUT "ENTER RADIUS";R
INPUT "ENTER HEIGHT";H
PRINT "VOL OF CYLINDER=";VOL (R,H)
END
FUNCTION VOL (R,H)
V= 22 / 7 * R ^ 2 * H
VOL=V
END FUNCTION
#8 AREA OF TRIANGLE
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 FUNCTION
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 FUNCTION
Tuesday, October 22, 2019
#7 DISPLAY REVERSE OF INPUT STRING
DECLARE SUB REV $ (N$)
CLS
INPUT "ENTER ANY NUMBER ";N$
CALL REV$(N$)
END
SUB REV$ (N$)
FOR I = LEN(N$) TO 1 STEP -1
B$= MID$ (N$,I,1)
C$ = C$+ B$
NEXT I
PRINT "REVERSE OF INPUT STRING";R
END SUB
CLS
INPUT "ENTER ANY NUMBER ";N$
CALL REV$(N$)
END
SUB REV$ (N$)
FOR I = LEN(N$) TO 1 STEP -1
B$= MID$ (N$,I,1)
C$ = C$+ B$
NEXT I
PRINT "REVERSE OF INPUT STRING";R
END SUB
#6 COUNT TOTAL NO OF VOWEL IN WORD
DECLARE FUNCTION COUNT (N$)
CLS
INPUT "ENTER ANY NUMBER";N$
PRINT "TOTAL NO OF VOWELS IN WORD";COUNT(N$)
END
FUNCTION COUNT (N$)
C=0
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
CLS
INPUT "ENTER ANY NUMBER";N$
PRINT "TOTAL NO OF VOWELS IN WORD";COUNT(N$)
END
FUNCTION COUNT (N$)
C=0
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
#5 AREA OF 4 WALLS
DECLARE SU 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
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
#4 COUNT TOTAL NO OF VOWELS IN SENTENCE
DECLARE FUNCTION COUNT (N$)
CLS
INPUT "ENTER ANY NUMBER ";N$
PRINT "TOTAL NO OF WORDS ";COUNT(N$)
END
FUNCTION COUNT (N$)
C=0
WHILE N<>0
R = N MOD 10
C = C + 1
N = N \ 10
WEND
COUNT = C
END FUNCTION
CLS
INPUT "ENTER ANY NUMBER ";N$
PRINT "TOTAL NO OF WORDS ";COUNT(N$)
END
FUNCTION COUNT (N$)
C=0
WHILE N<>0
R = N MOD 10
C = C + 1
N = N \ 10
WEND
COUNT = C
END FUNCTION
#3 AREA OF CIRCLE
DECLARE SUB AREA (R)
CLS
INPUT "ENTER RADIUS";R
CALL AREA (R)
END
SUB AREA (R)
R = 22 / 7 * R ^ 2
PRINT "AREA OF CIRCLE";A
END SUB
CLS
INPUT "ENTER RADIUS";R
CALL AREA (R)
END
SUB AREA (R)
R = 22 / 7 * R ^ 2
PRINT "AREA OF CIRCLE";A
END SUB
#2 TOTAL NO OF VOWELS IN WORD
DECLARE SUB COUNT (N$)
CLS
INPUT"ENTER ANY WORD";N$
CALL COUNT (N$)
END
SUB COUNT (N$)
C=0
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$="0"OR C$="U" THEN C = C+1
NEXT I
PRINT "TOTAL NO OF VOWELS";C
END SUB
CLS
INPUT"ENTER ANY WORD";N$
CALL COUNT (N$)
END
SUB COUNT (N$)
C=0
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$="0"OR C$="U" THEN C = C+1
NEXT I
PRINT "TOTAL NO OF VOWELS";C
END SUB
#1 AVERAGE OF 3 NUMBERS
DECLARE FUNCTION AVG (A,B,C)
CLS
INPUT"Enter first number";A
INPUT"Enter second number";B
INPUT"Enter third number";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
CLS
INPUT"Enter first number";A
INPUT"Enter second number";B
INPUT"Enter third number";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
Subscribe to:
Posts (Atom)