CLS
INPUT "Enter length";L
INPUT "Enter breadth";B
A = L * B
PRINT " area of rectangle";A
END
Search This Blog
Monday, October 14, 2019
2.To Find area of circle
CLS
INPUT " Enter radius";R
C = 22 / 7 * R ^ 2
PRINT " area of circle";C
END
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
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
INPUT "Enter length";L
INPUT "Enter breadth";B
INPUT "Enter height";H
V = L * B * H
PRINT "Volume of box";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
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
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
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
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
Subscribe to:
Posts (Atom)