CLS
A=1
B=1
FOR I= 1to 10
PRINT A
C=A+B
A=B
B=C
NEXT I
END
Wednesday, 30 October 2019
Armstrong
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 given no is Armstrong
ELSE
PRINT “The given no is not Armstrong
END IF
END
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 given no is Armstrong
ELSE
PRINT “The given no is not Armstrong
END IF
END
Palindrome
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 give no is palindrome
ELSE
PRINT “The give no is not palindrome
END IF
END
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 “Products of digits =“;p
END
INPUT “Enter any number”;N
P=1
WHILE N<>0
R= N MOD 10
P= P*R
N=N\10
WEND
PRINT “Products of digits =“;p
END
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
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
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
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
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
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 box
CLS
INPUT “Enter length”;L
INPUT “Enter breath”;B
INPUT “Enter height”; H
V=L*B*H
PRINT “Volume of box”; V
END
INPUT “Enter length”;L
INPUT “Enter breath”;B
INPUT “Enter height”; H
V=L*B*H
PRINT “Volume of box”; V
END
WAP To find area of 4 walls
CLS
INPUT “Enter the length”;L
TNPUT “Enter the breath “;B
INPUT “Enter the height”;H
A=2*H*(L+B)
PRINT “Area of 4 wall=“;A
END
INPUT “Enter the length”;L
TNPUT “Enter the breath “;B
INPUT “Enter the height”;H
A=2*H*(L+B)
PRINT “Area of 4 wall=“;A
END
WAP to find area of triangle
CLS
INPUT “Enter any three side value”;ABC
S=(A+B+C)/2
AR=S*(S-A)*(S-B)*(S-C)^(1/2)
PRINT “Area of triangle =“;AR
END
INPUT “Enter any three side value”;ABC
S=(A+B+C)/2
AR=S*(S-A)*(S-B)*(S-C)^(1/2)
PRINT “Area of triangle =“;AR
END
WAP to find the area of rectangle
CLS
INPUT “Enter length “L
INPUT “Enter breath “B
A=L*B
PRINT “Area of rectangle”;A
END
INPUT “Enter length “L
INPUT “Enter breath “B
A=L*B
PRINT “Area of rectangle”;A
END
Subscribe to:
Posts (Atom)