Program to find total no. of vowels in a given word using SUB DECLARE SUB DISPLAY(N$) CLS INPUT"ENTER ANY WORD";N$ CALL DISPLAY(N$) END SUB DISPLAY(N$) FOR I= 1 TO LEN(N$) B$= MID$(N$,I,1) C$= UCASE$(B$) IF C$="A" OR C$="E" OR C$="E" OR C$="I" OR C$="O" OR C$="U" THEN D$=D$+B$ NEXT I PRINT"VOWELS=";D$ END SUB
Posts
Showing posts from October, 2019
- Get link
- X
- Other Apps
Program to find total no. of vowels in a word using FUNCTION DECLARE FUNCTION COUNT(N$) CLS INPUT"ENTER ANY WORD";N$ PRINT"Total no. of vowels=";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" OR C$="E" OR C$="I" OR C$="O" OR C$="U" THEN C=C+1 NEXT I COUNT=C END FUNCTION
- Get link
- X
- Other Apps
Program to find greatest among 3 numbers using 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) SUB SUB GREAT(A,B,C) IF A>B AND A>C THEN PRINT"GREATEST NUMBER IS";A ELSEIF B>A AND B>C THEN PRINT"GREATEST NUMBER IS";B ELSE PRINT"GREATEST NUMBER IS";C END IF END SUB
- Get link
- X
- Other Apps
Program to check whether the given no is armstrong number or not using FUNCTION DECLARE FUNCTION ARM(N) CLS INPUT"ENTER ANY NUMBER";N A=P P=ARM IF A=P THEN PRINT"The given no is armstrong" ELSE PRINT"The given no is not armstrong" END IF END FUNCTION ARM(N) S=0 WHILE N<>0 R=N MOD 10 S=S+R^3 N=N\10 WEND ARM=S END FUNCTION
- Get link
- X
- Other Apps
Program to check whether the given word is palindrome string or not using FUNCTION DECLARE FUNCTION PAL$(N$) CLS INPUT"ENTER ANY WORD";N$ P$=PAL$(N$) IF N$=P$ THEN PRINT"The given word is palindrome" ELSE PRINT"The given word is not palindrome" 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 FUNCITON
- Get link
- X
- Other Apps
Program to check whether the given no is armstrong number or not using FUNCTION DECLARE FUNCTION ARM(N) CLS INPUT"ENTER ANY NUMBER";N A=P P=ARM IF A=P THEN PRINT"The given no is armstrong" ELSE PRINT"The given no is not armstrong" END IF END FUNCTION ARM(N) S=0 WHILE N<>0 R=N MOD 10 S=S+R^3 N=N\10 WEND ARM=S END FUNCTION