Category: Basic Programs

Basic Program To adding one bye one from left – Pyramid

REM ADDING ONE BY ONE FROM LEFT- PYRAMID
CLS
LET Q$ = “PROGRAM”
LET W = LEN(Q$)
FOR I = 1 TO W
R$ = LEFT$(Q$, I)
PRINT R$
NEXT
END

Please follow and like us:
Basic Program To adding one bye one from right – Pyramid

REM ADDING ONE BY ONE FROM RIGHT- PYRAMID
CLS
LET Q$ = “PROGRAM”
LET W = LEN(Q$)
FOR I = 1 TO W
R$ = RIGHT$(Q$, I)
PRINT R$
NEXT
END

Please follow and like us:
Basic Program To Inverted Pyramid – Dropping from left one by one

REM INVERTED PYRAMID-DROPPING FROM LEFT ONE BY ONE
CLS
LET Q$ = “PROGRAM”
LET W = LEN(Q$)
E = W
WHILE E > 0
LET R$ = RIGHT$(Q$, E)
PRINT R$
E = E – 1
END

Please follow and like us:
Basic Program To Inverted Pyramid – Dropping from right one by one

REM INVERTED PYRAMID-DROPPING FROM RIGHT ONE BY ONE
CLS
LET Q$ = “PROGRAM”
LET W = LEN(Q$)
E = W
WHILE E > 0
LET R$ = LEFT$(Q$, E)
PRINT R$
E = E – 1
END

Please follow and like us:
Basic Program To Compare Two Number and tell Which is Bigger or Smaller

REM COMPARE TWO NUMBERS AND TELL WHICH IS BIGGER OR SMALLER
CLS
10 : INPUT “ENTER THE NUMBER OF PAIRS TO BE COMPARED “; Q
15 : FOR I = 1 TO Q
16 : INPUT “ENTER THE FIRST NO “; E
20 : INPUT “ENTER THE SECOND NO”; W
30 : IF E > W THEN 40 ELSE 60
40 : PRINT “FIRST NO.E >SECOND NO. W”
50 : GOTO 70
60 : PRINT “FIRST NUMBER E=>SECOND NUMBER Q”
65 : NEXT I
70 : END

Please follow and like us:
Basic Program To adding – between String

REM REPEATED..ADDING – BETWEEN TWO STRINGS
CLS
A$ = “SUPER”
B$ = “-”
C$ = “COMPUTER”
D$ = A$ + B$ + C$
PRINT D$
END

Please follow and like us:
Basic Program To Print Sum of Even Numbers in First 10 Natural Numbers

REM SUM OF EVEN NUMBERS IN FIRST 10 NATURAL NUMBERS
CLS
SUM = 0
FOR F = 10 TO 1 STEP -2
SUM = SUM + F
PRINT F, SUM
NEXT F
PRINT ” SUM”; SUM
END

Please follow and like us:
Basic Program To Print Sum of First 10 Odd Numbers

REM THE NAME IS INCORRCT. PROG GIVES SUM OF FIRST 10 ODD NUMBERS
CLS
SUM = 0
FOR I = 1 TO 10
LET X = 2 * I – 1
SUM = SUM + X
PRINT ” ODD NUMBER AT POSITION”; I; “IS”; X
NEXT I
PRINT “TOTAL SUM”, SUM
END

Please follow and like us:
Basic Program To Print Sum of First 100 Numbers

REM SUM OF FIRST 100 NOS.
CLS
SUM = 0
FOR F = 1 TO 100
PRINT “NO. IS “; F
LET SUM = SUM + F
NEXT F
PRINT “SUM”; SUM
END

Please follow and like us:
Basic Program To Print Sum of Square of First 10 Even Numbers

REM TAKE A NUMBER, SQUARE IT
CLS
SUM = 0
FOR F = 1 TO 10
LET X = 2 * F – 1
LET D = X * X
SUM = SUM + D
PRINT F, X, D, SUM
NEXT F
PRINT
PRINT “SUM OF FIRST 10 EVEN SQUARES IS”, SUM
END

Please follow and like us: