This action might not be possible to undo. Are you sure you want to continue?

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

1. Sum of two Numbers; DECLARE SUB SUM (A, B) CLS INPUT “ENTER A NUMBER”; A INPUT “ENTER A NUMBER”; B CALL SUM (A, B) END SUB SUM (A, B) S=A+B PRINT “THE SUM OF “; A;”AND”; B;”IS”; S END SUB 2. Area of Square; DECLARE SUB AREA (E) CLS INPUT “ENTER THE LENGTH”; E CALL AREA (E) END SUB AREA (E) A=E*E PRINT “THE AREA OF THE SQUARE IS”; A END SUB 3. Greater/Smaller Number; DECLARE SUB GRE (A, B) CLS INPUT “ENTER A NUMBER”; A INPUT “ENTER A NUMBER”; B CALL GRE (A, B) END SUB GRE (A, B) IF A > B THEN PRINT A;”IS GREATER NUMBER” ELSE PRINT B;”IS THE GREATER NUMBER” END SUB 4. Greater Number among 3 Different Numbers; DECLARE SUB GRE (A, B, C) CLS INPUT “ENTER A NUMBER”; A INPUT “ENTER A NUMBER”; B INPUT “ENTER A NUMBER”; C CALL GRE (A, B, C) END

SUB GRE (A, B, C) IF A > B AND A > C THEN PRINT A;”IS THE GREATEST” ELSEIF B > A AND B > C THEN PRINT B;”IS THE GREATEST” ELSE PRINT C;”IS THE GREATEST” END IF END SUB 5. Prime Number; DECLARE SUB PRIME (N) CLS INPUT “ENTER A NUMBER”; N CALL PRIME (N) END SUB PRIME (N) FOR I = 1 TO N R = N MOD I IF R = 0 THEN C = C + 1 NEXT I IF C = 2 THEN PRINT “IT IS PRIME NUMBER” ELSE PRINT “IT IS COMPOSITE NUMBER” END IF END SUB 6. Armstrong Number; DECLARE SUB ARM (N) CLS INPUT “ENTER A NUMBER”; N CALL ARM (N) END SUB ARM (N) A=N WHILE A< > 0 R = A MOD 10 S=S+R^3 A = A\10 WEND IF S = N THEN PRINT N;”IS AN ARMSTRONG” ELSE PRINT N;”IS NOT AN ARMSTRONG” END IF END SUB 7. Palindrome; (A)Number; DECLARE SUB PAL (N)

CLS INPUT “ENTER A NUMBER”; N CALL PAL (N) END SUB PAL (N) A=N WHILE A< > 0 R = A MOD 10 S = S * 10 + R A = A \ 10 WEND IF S=N THEN PRINT N;”IS A PALINDROME” ELSE PRINT N;”IS NOT A PALINDROME” END IF END SUB (B)Word; DECLARE SUB PAL (N$) CLS INPUT “ENTER A WORD”; N$ CALL PAL (N$) END SUB PAL (N$) FOR I = 1 TO LEN (N$) B$ = MID$(N$, I, 1) C$ = B$ + C$ NEXT I IF N$ = C$ THEN PRINT N$;”IS PALINDROME WORD” ELSE PRINT N$;”IS NOT PALINDROME WORD” END IF END SUB 8. Reverse Order (A)Number; DELCARE SUB REV (A) CLS INPUT “ENTER A NUMBER”; A CALL REV (A) END SUB REV (A) WHILE A< > 0 R = A MOD 10 S = S * 10 + R A = A \ 10 WEND PRINT S;” IS THE REVERSE OF”; A END SUB

(B)Word; DECLARE SUB REV (A$) CLS INPUT “ENTER A WORD”; A$ CALL REV (A$) END SUB REV (A$) FOR I=1 TO LEN (A$) B$ = MID$(A$, I, 1) C$ = B$ + C$ NEXT I PRINT C$;” IS THE REVERSE OF;”A$ END SUB 10. Even and Odd; DECLARE SUB EVOD (N) CLS INPUT “ENTER A NUMBER”; N CALL EVOD (N) END SUB EVOD (N) A = N MOD 2 IF A = 0 THEN PRINT N;”IS EVEN” ELSE PRINT N;”IS ODD” END IF END SUB

- On Writing
- The Shell Collector
- I Am Having So Much Fun Here Without You
- The Rosie Project
- The Blazing World
- Hyperbole and a Half
- Quiet Dell
- After Visiting Friends
- Missing
- Birds in Fall
- The Great Bridge
- Who Owns the Future?
- The Wife
- On Looking
- Catch-22
- A Farewell to Arms
- Goat Song
- Birth of the Cool
- Girl Reading
- Galveston
- Telex from Cuba
- Rin Tin Tin
- The White Tiger
- The Serialist
- No One Belongs Here More Than You
- Love Today
- Sail of Stone
- All My Puny Sorrows
- Fourth of July Creek
- The Walls Around Us

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd