Q.1) 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
Q.2) WAP to find the area of square.
=> CLS
INPUT "Enter length"; L
A = L ^ 2
PRINT "Area of square = "; A
END
Q.3) WAP to find the area of circle.
=> CLS
INPUT "Enter radius"; R
CONST PI =22/7
A = PI * R ^2
PRINT "Area of circle = "; A
END
Q.4) WAP to find the area of triangle.
=> CLS
INPUT "Enter base"; B
INPUT "Enter height"; H
A = 1/2 * B * H
PRINT "Area of triangle = "; A
END
Q.5) WAP to find the area of parallelogram.
=> CLS
INPUT "Enter base"; B
INPUT "Enter height"; H
A = B * H
PRINT "Area of parallelogram "; A
END
Q.6) WAP to check whether the number is divisible by 3 and 7 or not.
=> CLS
INPUT "Enter any number"; A
R1 = A MOD 3
R2 = A MOD 7
IF R1 = 0 AND R2 = 0 THEN
PRINT "Number is divisible by 3 and 7"
ELSE
PRINT "Number is not divisible by 3 and 7"
END IF
END
Q.7) WAP to check whether the given number is positive/ negative/ zero.
=> CLS
INPUT "Enter any number"; A
IF A >0 THEN
PRINT "Number is positive"
ELSEIF A <0 THEN
PRINT "Number is negative"
ELSE
PRINT "Number is zero"
END IF
END
Q.8) WAP to check whether the number is odd or even.
=> CLS
INPUT "Enter any number" ; A
R = A MOD 2
IF R = 1 THEN
PRINT "Number is odd"
ELSE
PRINT "Number is even"
END IF
END
Q.9) WAP to enter any 3 numbers and find the smallest one.
=> CLS
INPUT "Enter any three numbers" ; A, B, C
IF A< B AND A< C THEN
PRINT A ; " is the smallest number."
ELSEIF B<A AND B<C THEN
PRINT B ; " is the smallest number."
ELSEIF C<A AND C<B THEN
PRINT C ; " is the smallest number."
ELSE
PRINT "All the numbers are equal."
END IF
END
Q.10) WAP to enter name and percentage and print the name, percentage and the division passed in.
=> CLS
INPUT "Enter name"; N$
INPUT "Enter percentage"; P
IF P>= 80 AND P<=100 THEN
D$ = "Distinction"
ELSEIF P>= 60 AND P<=69.9 THEN
D$ = "First Division"
ELSEIF P>=50 AND P<= 59.9 THEN
D$ = "Second Division"
ELSEIF P>=40 AND P<=49.9 THEN
D$ = "Third Division"
ELSEIF P<40 THEN
D$ = "Failed"
ELSE
D$ = "Wrong Entry"
END IF
PRINT "Name", "Percentage", "Division"
PRINT N$, P, D$
END