Tuesday, 22 October 2019

20) Multiplication of table.

=> CLS
INPUT "Enter any number"; N
FOR I = 1 TO 10
PRINT N ; "X' ; I ; "=" ; N*I
NEXT I
END

19) Factorial

=> CLS
INPUT "Enter any number"; N
F = 1
FOR I = 1 TO N
F = F*I
NEXT I
PRINT "Factorial="; F
END

18) Factors.

=> CLS
INPUT "Enter any number"; N
FOR I = 1 TO N
IF N MOD I = 0 THEN PRINT I
NEXT I
END

17) prime or composite.

=>CLS
INPUT "Enter any number"; N
C = 0
FOR I = 1 TO N
IF N MOD I = 0 THEN C = C+1
NEXT I
IF C = 2 THEN
PRINT "The number is prime"
ELSE
PRINT "The number is composite"
END IF
END

16) Armstrong or not.

=> CLS
INPUT "Enter any number";N
A = N
S = 0
WHILE N <> 0
R = N MOD 10
S = S+R^3
N = N\10
WEND
IF A=S THEN
PRINT "The number is armstrong"
ELSE
PRINT "The number is not armstrong"
END IF
END

15) palindrome or not.

=> CLS
INPUT "Enter any number"; N
A = N
S = 0
WHILE N <> 0
R = N MOD 10
S = S*10+R
N = N\10
WEND
IF A= S THEN
PRINT " The number is palindrome"
ELSE
PRINT "The number is not palindrome"
END IF
END

14) Reverse digits.

=> CLS
INPUT "Enter any number"; N
S = 0
WHILE N<> 0
R = N MOD 10
S = S*10+R
N = N\10
WEND
PRINT "Reverse of digits="; S

END

Experience

  My  Experience              of   educational tour An educational tour is a fun – filled experience. As the tour may be too far away p...