DECLARE SUB SERIES ( )
CLS
CALL SERIES
END
SUB SERIES
A = 1
B = 2
FOR I = 1 TO 13
PRINT A;
C = A+B
A = B
B = C
NEXT I
END SUB
Wap to check whether the given number is perfect square or not
DECLARE FUNCTION PERFECT (S)
CLS
INPUT "ENTER ANY NUMBER"; N
S = SQR(N)
PR = PERFECT (S)
IF PR = S THEN
PRINT "PERFECT SQUARE"
ELSE
PRINT "NOT PERFECT SQUARE"
END IF
END
FUNCTION PERFECT (S)
PERFECT = INT (S)
END FUNCTION
CLS
INPUT "ENTER ANY NUMBER"; N
S = SQR(N)
PR = PERFECT (S)
IF PR = S THEN
PRINT "PERFECT SQUARE"
ELSE
PRINT "NOT PERFECT SQUARE"
END IF
END
FUNCTION PERFECT (S)
PERFECT = INT (S)
END FUNCTION
Wap to find whether the given number is positive negative or zero
DECLARE SUB CHECK(N)
CLS
INPUT"ENTER ANY NO.";N
CALL CHECK(N)
END
SUB CHECK(N)
IF N>0 THEN
PRINT"NUMBER IS POSITIVE"
ELSE IF N<0 THEN
PRINT"NUMBER IS NEGATIVE"
ELSE
PRINT"NUMBER IS NEUTRAL"
END IF
END SUB
CLS
INPUT"ENTER ANY NO.";N
CALL CHECK(N)
END
SUB CHECK(N)
IF N>0 THEN
PRINT"NUMBER IS POSITIVE"
ELSE IF N<0 THEN
PRINT"NUMBER IS NEGATIVE"
ELSE
PRINT"NUMBER IS NEUTRAL"
END IF
END SUB
Wap to erase vowels from given string
DECLARE FUNCTION ERA(A$)
CLS
INPUT"ENTER ANY STRING";A$
PRINT"STRING WITHOUT VOWELS =";ERA(A$)
END
FUNCTION ERA(A$)
FOR I = 1 TO LEN (A$)
B$=MID$(A$,I,1)
C$=UCASE$(B$)
IF C$<>"A" AND C$<>'E" AND C$<>"I" AND C$<>"O" AND C$<>"U" THEN D$=D$+C$
END IF
NEXT I
ERA=D$
END FUNCTION
CLS
INPUT"ENTER ANY STRING";A$
PRINT"STRING WITHOUT VOWELS =";ERA(A$)
END
FUNCTION ERA(A$)
FOR I = 1 TO LEN (A$)
B$=MID$(A$,I,1)
C$=UCASE$(B$)
IF C$<>"A" AND C$<>'E" AND C$<>"I" AND C$<>"O" AND C$<>"U" THEN D$=D$+C$
END IF
NEXT I
ERA=D$
END FUNCTION
Wap to check the character is capital or small
DECLARE FUNCTION CHECK$(A$)
CLS
INPUT"ENTER ANY CHARACTER";A$
PRINT"THE ENTERED CHARATER IS"; CHECK$(C$)
END
FUNCTION CHECK$(A$)
C = ASC(A$)
IF C>=65 AND C<=91 THEN
CHECK$="UPPER CASE"
ELSEIF C>=97 AND C<=122 THEN
CHECK$="LOWER CASE"
ELSE
CHTR$="NOT A CHARACTER"
END IF
END FUNCTION
WAP TO DISPLAY 50, 42, 35, 29, 24 1O.......TERM
DECLARER SUB SERIES()
CLS
CALL SERIES
END
SUB SERIES()
A=50
B=8
FOR I = 1 TO 10
PRINT A
A=A-B
B=B-1
NEXT I
END
Wap to find the palindrome word
DECLARE FUNCTION REV$ (S$)
CLS
INPUT "ENTER ANY STRING"; S$
P$ = S$
IF P$ = REV$(S$) THEN
PRINT "THE GIVEN WORD IS PALINDROME "
ELSE
PRINT " THE GIVEN NO. IS NOT PALINDROME"
END IF
END
FUNCTION REV$ (S$)
FOR I = LEN(S$) TO 1 STEP -1
B$ = MID$(S$, I, 1)
W$ = W$ + B$
NEXT I
REV$ = W$
END FUNCTION
CLS
INPUT "ENTER ANY STRING"; S$
P$ = S$
IF P$ = REV$(S$) THEN
PRINT "THE GIVEN WORD IS PALINDROME "
ELSE
PRINT " THE GIVEN NO. IS NOT PALINDROME"
END IF
END
FUNCTION REV$ (S$)
FOR I = LEN(S$) TO 1 STEP -1
B$ = MID$(S$, I, 1)
W$ = W$ + B$
NEXT I
REV$ = W$
END FUNCTION
Wap To check whether the given no. is prime or composite
DECLARE SUB PRIME (N)
INPUT "ENTER ANY NUMBER"; N
CALL PRIME (N)
END
SUB PRIME (N)
C = 0
FOR I = 1 TO N
IF N MOD I = 0 THEN C = C + 1
NEXT I
IF C = 2 THEN
PRINT N; "IS PRIME NUMBER"
ELSE
PRINT N; "IS COMPOSITE NUMBER"
END IF
END SUB
INPUT "ENTER ANY NUMBER"; N
CALL PRIME (N)
END
SUB PRIME (N)
C = 0
FOR I = 1 TO N
IF N MOD I = 0 THEN C = C + 1
NEXT I
IF C = 2 THEN
PRINT N; "IS PRIME NUMBER"
ELSE
PRINT N; "IS COMPOSITE NUMBER"
END IF
END SUB