Wednesday, 30 October 2019

Sum of digits

CLS
INPUT “ Enter any number”N
S = o
WHILE N<>0
R = N MOD 10
S = S+ R
N = N\ 10
WEND
PRINT “Sum of digits=“;S
END

Greatest among 3 number

CLS
INPUT “Enter any three number”;ABC
IF A > B and B > C THEN
PRINT “The greatest number is”;A
ELSE IF B > A AND B > C THEN
PRINT “The greatest number is “;B
ELSE
PRINT “The greatest number”; C
END IF
END

Display odd or even

CLS
INPUT “Enter any number”;N
IF N MOD 2 = 0 THEN
PRINT “The given number is even”
ELSE
PRINT “The given number is odd
END IF
END

WAP To find positive negative or zero

CLS
INPUT “Enter any number”;N
IF N>0 THEN
PRINT “Positive number”
ELSE If N <0 Then
PRINT “Negative number”
ELSE
PRINT “Zero number”
END

WAP To find volume of cyclinder

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

Monday, 14 October 2019

WAP To find volume of cube

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

WAP To find volume of box

CLS
INPUT “Enter length”;L
INPUT “Enter breath”;B
INPUT “Enter height”; H
V=L*B*H
PRINT “Volume of box”; V
END