Dashain and tihar homework

15 QBasic Programmes

           1) Program to find the area of rectangle.
CLS
INPUT " Enter length " ; L
INPUT " Enter breadth " ; B
A = L * B
PRINT " Area of rectangle = " ; A
END
           2) Program to display the area of circle.
CLS
INPUT " Enter radius " ; R
A = 22 / 7 * R ^ 2
PRINT " Area of circle " ; A
END
            3) Program to find the area of square.
CLS
INPUT " Enter length " ; L
A = L ^ 2
PRINT " Area of square = " ; A
END
            4) Program to find the area of triangle.
CLS
INPUT " Enter breadth " ; B
INPUT " Enter height " ; H
A = 1 / 2 * B * H
PRINT " Area of triangle = " ; A
END
            5) Program 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
            6) Program to input percentage and display pass or fail.
CLS
INPUT " Enter your percentage " ; P
IF P > = 75  THEN
PRINT " Pass "
ELSE 
PRINT " Fail "
END IF 
END
            7) Program to input any number and check odd or even.
CLS
INPUT " Enter any number " ; N
IF N MOD 2 = 0 THEN
PRINT " Even number "
ELSE 
PRINT " Odd number " 
END IF 
END
            8) Program to input any number and check positive, negative or zero.
CLS
INPUT " Enter the number " ; N
IF N > 0 THEN
PRINT " Positive number "
ELSEIF N < 0 THEN
PRINT " Negative number "
ELSE 
PRINT " Zero "
END IF 
END
             9) Program to input any number and check weather it is divisible by 5 or not.
CLS
INPUT " Enter any number " ; N
IF N MOD 5 = 0 THEN 
PRINT " The number is divisible by 5 "
ELSE
PRINT " The number is not divisible by 5 "
END IF 
END
           10) Program to display 5, 10, 15, ........., 50.
CLS
FOR N = 5 TO 50 STEP 5
PRINT N
NEXT N 
END
           11) Program to display 100, 90, 80, .........., 10.
CLS 
FOR I = 100 TO 10 STEP -10
PRINT I
NEXT I
END
           12) Program to display 2, 4, 6, 8, ........, 20.
CLS
FOR X = 2 TO 20 STEP 2
PRINT X
NEXT X
END
           13) Program to display 50, 45, 40, ........., 5.
CLS 
FOR A = 50 TO 5 STEP -5
PRINT A
NEXT A
END
           14) Program to find the product and difference of any two numbers.
CLS
INPUT " Enter first number " ; A
INPUT " Enter second number " ; B
P = A * B
D = A - B
PRINT " Product = " ; P
PRINT " Difference = " ; D
END
           15) Program to find the volume of rectangle.
CLS 
INPUT " Enter length " ; L
INPUT " Enter breadth " ; B
INPUT " Enter height " ; H
V = L * B * H
PRINT " Volume of rectangle = " ; V
END
                                 
                                                 THANK *** YOU!!!!!

      

Comments

Popular posts from this blog

Adhiko Manoram Nritya

Experience Of Tour To Dhading

Experience of Police Awareness Class