WAP to find the area of rectangle
CLS
INPUT" Enter length";L
INPUT" Enter breadth";B
A=L*B
PRINT" Area of rectangle";A
END
Tuesday, October 15, 2019
To display weather the number is prime or composite
WAP to display weather the number is 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" The number is prime"
ELSE
PRINT" The number is composite"
END IF
END
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" The number is prime"
ELSE
PRINT" The number is composite"
END IF
END
To display 1, 11, 111, 1111, 11111.
WAP to display 1, 11, 111, 1111, 11111.
CLS
A=1
FOR I = 1 to 5
PRINT A
A= A*10 +1
NEXT I
END
CLS
A=1
FOR I = 1 to 5
PRINT A
A= A*10 +1
NEXT I
END
To display 1, 22, 333, 4444, 55555
WAP 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
END
Monday, October 14, 2019
To display 1, 12, 123, 1234, 12345
WAP to display 1, 12, 123, 1234, 12345.
CLS
FOR I = 1 to 5
FOR J = 1 to I
PRINT I ;
NEXT J
PRINT
NEXT I
END
CLS
FOR I = 1 to 5
FOR J = 1 to I
PRINT I ;
NEXT J
NEXT I
END
To display 5, 10, 15, 20....10 term
WAP to display 5, 10. 15, 20......10 term
CLS
A=5
I=1
DO UNTIL I>10
PRINT A
A= A+5
I= I+1
LOOP
END
To display 1, 4, 9,.... 10 term
WAP to display 1, 4, 9,...... 10 term
CLS
A=1
DO UNTIL A> 10
PRINT A ^2
LOOP
END
CLS
A=1
DO UNTIL A> 10
PRINT A ^2
LOOP
END
To display 1, 1,2,3,5...10 term
WAP to display 1, 1, 2, 3, 5.... 10 term
CLS
A=1
B=1
FOR I = 1 to 10
PRINT A
C= A + B
A=C
B=C
NEXT I
END
CLS
A=1
B=1
FOR I = 1 to 10
PRINT A
C= A + B
A=C
B=C
NEXT I
END
To display the multiplication table
WAP to display the multiplication table
CLS
INPUT" Enter any number";N
FOR I= 1 to 10
PRINT N;"*";I:'=";N*I
NEXT I
END
CLS
INPUT" Enter any number";N
FOR I= 1 to 10
PRINT N;"*";I:'=";N*I
NEXT I
END
To display factorial
WAP to display factorial
CLS
INPUT"Enter any number";N
F=1
FOR I= 1 to N
F = F*I
NEXT I
PRINT" Factorial=";F
END
CLS
INPUT"Enter any number";N
F=1
FOR I= 1 to N
F = F*I
NEXT I
PRINT" Factorial=";F
END
To display factors
WAP to display factors
CLS
INPUT" Enter any number";N
INPUT" Enter any number";N
FOR I =1 THEN
IF N MOD I=0 THEN PRINT I
NEXT I
END
To display the armstrong
WAP to display armstrong
CLS
INPUT"Enter any number";N
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 number is armstrong"
ELSE
PRINT" The number is not armstrong"
END IF
END
To display the palindrome
WAP to display 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 number is palindrome"
ELSE
PRINT" The number is not palindrome"
END IF
END
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 number is palindrome"
ELSE
PRINT" The number is not palindrome"
END IF
END
To reverse the digits
WAP to reverse the digits
CLS
INPUT"Enter any number";N
S=0
WHILE N< >0
R=N MOD 10
S=S*10+R
N=N\10
WEND
PRINT"Reverse the digits";S
END
CLS
INPUT"Enter any number";N
S=0
WHILE N< >0
R=N MOD 10
S=S*10+R
N=N\10
WEND
PRINT"Reverse the digits";S
END
To display the products of digits
WAP to display the products of digits
CLS
INPUT"Enter any number";N
P=1
WHILE N< >0
R=N MOD 10
P= P*R
N=N\10
PRINT"Product of digits";P
END
CLS
INPUT"Enter any number";N
P=1
WHILE N< >0
R=N MOD 10
P= P*R
N=N\10
PRINT"Product of digits";P
END
To display the sum of digits
WAP to display the sum of digits
CLS
INPUT"Enter the digit";n
WHILE n< >o
R=N MOD 10
S= S+R
N=N\10
WEND
PRINT"Sum of digits";S
END
CLS
INPUT"Enter the digit";n
WHILE n< >o
R=N MOD 10
S= S+R
N=N\10
WEND
PRINT"Sum of digits";S
END
To display greatest among three numbers
WAP to display greatest among three numbers
CLS
INPUT"Enter first number";A
INPUT"Enter second number";B
INPUT"Enter third number";C
IF A>B and A>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 is ";C
END IF
END
CLS
INPUT"Enter first number";A
INPUT"Enter second number";B
INPUT"Enter third number";C
IF A>B and A>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 is ";C
END IF
END
To display odd or even
WAP to display weather the number is odd or even
CLS
INPUT"Enter any number";N
IF N MOD 2=0 THEN
PRINT"THe nmber is even"
ELSE
PRINT"The number is odd"
END IF
END
Display positive, negative or zero
WAP to display positive, negative or zero
CLS
INPUT"Enter any number";N
IF N>0 THEN
PRINT"The number is positive"
ELSE IF N<0 THEN
PRINT"The number is negative"
ELSE
PRINT"The number is zero"
END If
END
CLS
INPUT"Enter any number";N
IF N>0 THEN
PRINT"The number is positive"
ELSE IF N<0 THEN
PRINT"The number is negative"
ELSE
PRINT"The number is zero"
END If
END
Wednesday, October 9, 2019
volume of cylinder
WAP to find the volume of cylinder
CLS
INPUT"Enter radius"; r
INPUT"Enter height"; H
V= 22/7*r^2*H
PRINT"volume of cylinder";V
END
CLS
INPUT"Enter radius"; r
INPUT"Enter height"; H
V= 22/7*r^2*H
PRINT"volume of cylinder";V
END
volume of cube
WAP to find the volume of cube
CLS
INPUT"Enter length";L
V=L^3
PRINT"Volume of cube";V
END
CLS
INPUT"Enter length";L
V=L^3
PRINT"Volume of cube";V
END
Volume of box
WAP to find the 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
CLS
INPUT"Enter Length";L
INPUT"Enter Breadth";B
INPUT"#Enter Height";H
V=L*B*H
PRINT"Volume of box";V
END
Area of four walls
Wap to find the 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
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
Area of square
Wap to find the area of square
CLS
INPUT"Enter length";L
A=L^2
PRINT"Area of square";A
End
CLS
INPUT"Enter length";L
A=L^2
PRINT"Area of square";A
End
Area of circle
Wap to find the area of circle
CLS
INPUT"Enter radius"; r
A= 22/7*r^2
PRINT"Area of circle";A
END
CLS
INPUT"Enter radius"; r
A= 22/7*r^2
PRINT"Area of circle";A
END
Area of triangle
Wap to find the area of triangle
CLS
INPUT"Enter height";h
INPUT"Enter base";b
AR =1/2*b*h
PRINT" Area of triangle=";A
END
CLS
INPUT"Enter height";h
INPUT"Enter base";b
AR =1/2*b*h
PRINT" Area of triangle=";A
END
Area of rectangle
Wap to find the area of recatangle
CLS
INPUT"Enter length";L
INPUT"Enter breadth";B
A=L*B
PRINT"Area of rectangle";A
END
CLS
INPUT"Enter length";L
INPUT"Enter breadth";B
A=L*B
PRINT"Area of rectangle";A
END
Subscribe to:
Posts (Atom)
5 days and 4 night Educational Tour We travel not to escape life but for life not to escape us . O ur school organized educ...
-
Janai Purnima Those who celebrate it as Janai Purnima in the hilly regions of Nepal, it is taken as a day when the men ...
-
My experience on Daging visitMy experience on the Dhading visit was so enjoyable and remember able. I was ...