Search This Blog

Monday, October 14, 2019

1.To Find area of rectangle

CLS
INPUT "Enter length";L
INPUT "Enter breadth";B
A = L * B
PRINT " area of rectangle";A
END

2.To Find area of circle

CLS 
INPUT " Enter radius";R
C = 22 / 7 * R ^ 2
PRINT " area of circle";C
END

3. To Find area of triangle

CLS
INPUT "Enter breadth"; B
INPUT "Enter height"; H
A = 1 / 2  * (B * H)
PRINT "area of triangle"; A
END

4. To Find area of square

CLS 
INPUT "Enter length";L
A = L ^ 2
PRINT "area of square";A
END

5. To Display area of four walls

CLS
INPUT “Enter length”; L
INPUT “Enter breadth”; B
INPUT “Enter height”; H
A = 2 * H * (L + B)
PRINT “Area of four walls“; A
END

6. To Display Volume of box

CLS
INPUT "Enter length";L
INPUT "Enter breadth";B
INPUT "Enter height";H
V = L * B * H
PRINT "Volume of box";V
END

7. To Display Volume of cube

CLS
INPUT " Enter length";L
V = L ^ 3
PRINT " Volume of cube";V
END

8. To Display Volume of Cylinder

CLS 
INPUT "Enter radius";R
INPUT "Enter Height";H
V =  22 / 7 * R ^ 2 * H
PRINT "Volume of cylinder";V
END

9. To Display Positive Negative or Zero

CLS
INPUT "Enter a number";N
IF N > 0 THEN
PRINT "The number is Positive"
ELSEIF N < 0 THEN
PRINT "The number is Negative"
ELSE
PRINT "The number is Zero"
END IF
END

10. To Display Odd or Even

CLS
INPUT "Enter a number: ", N
IF N MOD 2 = 0 THEN
PRINT "The number is EVEN."
ELSE
PRINT "The number is ODD."
END IF
END

11. To Display greater among three number

CLS
INPUT " Enter and three number " ; N
IF A > B AND B > C THEN
PRINT "Greater number is "; A
ELSEIF B > A AND B > C THEN
PRINT "Greater number is ": B
ELSE 
PRINT "Greater number is ";C
END IF
END

12. To Display Sum of digit

CLS
INPUT "Enter any digit"; N
S = 0

WHILE N <> 0
R = N MOD 10
S = S + R
N = N \ 10
WEND
PRINT "Sum of digits is "; S
END

13. To Display Product of digit

CLS
INPUT "ENTER ANY NUMBER"; N
P = 1
WHILE N < > 0
R = N MOD 10
P = P * R
N = N \ 10
WEND
PRINT "PRODUCT OF DIGITS"; P
END

14. To Display reverse digit

CLS
INPUT "Enter any number"; N
S = 0

WHILE N <> 0
R = N MOD 10
S = S * 10 + R
N = N \ 10
WEND
PRINT "Reversed digits is "; S
END

15. To Display the given number is 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 given number is palindrome"
ELSE
PRINT"the given number is not palindrome"
END IF

END

Sunday, October 13, 2019

16. To Display armstrong

CLS
INPUT "Enter a 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 "It is armstrong number";
ELSE
PRINT "It is not armstrong number";
END IF
END

17. To Display 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 N; "IS PRIME NUMBER"
ELSE
PRINT N; "IS COMPOSITE NUMBER"
END IF
END

18. To Display Factor

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

19. To Display Factorial number

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

20. To Display multiplication table

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

21. To Display 1,1,2,3,5,8....10th term

CLS
A = 1

B = 1
FOR I = 1 To 10
C = A + B
A = B
B = C
NEXT I
END

22. To Display 1,4,9,16......10th term

CLS
FOR I = 1 To 10

PRINTI^2
NEXT I
END

23. To Display 5,10,15,20........10th term

CLS
A = 5

FOR I = 1 To 10
PRINT A
A = A + 5
NEXT I
END

24. To Display 1,12,123,1234,12345

CLS
FOR I = 1 To 5
FOR J=  1 To I
PRINT J;
NEXT J

PRINT 
NEXT I
END

25. To Display 1,22,333,4444,55555

CLS
FOR I = 1 To 5
 FOR J = 1 To I
  PRINT I;
    NEXT J
  PRINT
 NEXT I
END