# print only vowels from a given word. (sub) DECLARE SUB DISP(N$) CLS INPUT "Enter any word";N$ CALL DISP(N$) END SUB DISP(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 V$=V$+B$ NEXT I PRINT "Vowel";V$ END SUB
Posts
Showing posts from October, 2019
- Get link
- X
- Other Apps
# Input string and count total no of consonant. (function) DECLARE FUNCTION COUNT(n$) CLS INPUT"Enter any number";n$ PRINT"total no of consonant =";COUNT(n$) END FUNCTION COUNT(n$) C=0 FOR I=1TO 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
- Get link
- X
- Other Apps
# Display greatest among three no. (sub) DECLARE SUB GREAT(a,b,c) CLS INPUT "Enter first number";a INPUT "Enter second number";b INPUT "Enter third number";c CALL GREAT(a,b,c) END SUB GREAT(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 FUNCTION