Thursday, October 31, 2019

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

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

Wap to find factorial of given no.

DECLARE FUNCTION factorial (n)
CLS
INPUT "Enter a number"; n
PRINT "The factorial of the given number is"; factorial(n)
END

FUNCTION factorial (n)
f = 1
FOR i = 1 TO n
    f = f * i
NEXT i
factorial = f

END SUB

Wap to find whether the given no. is positive or negative

DECLARE SUB CHECK(N)
CLS
INPUT"ENTER ANY NO.";N
CALL CHECK(N$)
END

SUB CHECK(N)
IF N > 0 THEN
PRINT"POSITIVE NO."
ELSE IF N  < 0 THEN
PRINT"NEGATIVE NO."
ELSE
PRINT"ZERO"
END IF
END SUB

Display 9,7,5....1

DECLARE SUB SERIES()
CLS
CALL SERIES
END

SUB SERIES()
FOR I = 9 TO 1 STEP-2
PRINT I
NEXT I
END SUB

Wap to calculate distance travelled by body

DECLARE FUNCTION DIS(U,T,A)
CLS
INPUT"ENTER VELOCITY";U
INPUT"ENTER TIME";T
INPUT"ENTER ACCELERATION";A
PRINT"DISTANCE TRAVELLED BY BODY IS ";DIS(U,T,A)
END

FUNCTION DIS(U,T,A)
DIS=U*T+1/2*A*T^2
END FUNCTION

Wap to print only vowels from given word

DECLARE SUB DIS(N$)
CLS
INPUT"ENTER ANY WORD";N$
CALL DIS(N$)
END

SUB DIS(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
PRINT C$
NEXT I
END SUB

Journey with jagat mandir

        My journey with Jagat Mandir School My first day and my first step in jagat mandir was on 2067. On the first day I came with my ...