Wednesday, 2 October 2019

Wap to display product of digits

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

Wap to display sum of digits

CLS
INPUT "Enter any digit"; n
WHILE n <> 0
r = n MOD 10
s = s + r
n = n \ 10
WEND
PRINT "Sum of digits is "; s
END

Wap to display greatest among three number

CLS
INPUT "Enter the first number"; a
INPUT "Enter the second number"; b
INPUT "Enter the third number"; c
IF a > b AND a > c THEN

PRINT "The greatest number is "; a
ELSEIF b > a AND b > c THEN
PRINT "The greatest number is "; b
ELSE
PRINT "The greatest number is "; c
END IF
END

Wap to display odd or even

CLS
INPUT"ENTER ANY NUMBER"N

IF N MOD 2 =0 THEN
PRINT "EVEN";
ELSE
PRINT "ODD";
END IF
END

Wap 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

Monday, 30 September 2019

wap to display volume of cylinder

CLS
INPUT "Enter the  radius"; r
INPUT "Enter the height"; h
v = 22/7 * r ^ 2 * h
PRINT "The volume of the cylinder is"; v
END

wap to display volume of cube

CLS
INPUT"ENTER LENGTH";L
V = L^3
PRINT"VOLUME OF CUBE";V
END