Project work
Computer Project💻💻💻
Write QBASIC program:
(1) Wap to check whether the no is divisible by 3 and 7 or not.
CLS
Input"enter any number";N
If N MOD 3=0 AND N MOD 7=0 THEN
PRINT"the no is divisible by 3 and 7"
Else
PRINT"the no is not divisible by 3 and7"
END IF
END
(2) Wap To check whether the given no is positive or negative.
CLS
Input"enter any number";N
If N>0 THEN
PRINT"the no is positive"
ELSEIF N<0 THEN
PRINT"the no is negative"
END IF
END
(3)Wap to display the given no is odd or even
CLS
Input"enter any number";N
If N MOD 2=0 THEN
PRINT"No is even"
ELSE
Print"No is odd"
END IF
END
(4) Wap to display smaller no among two input numbers
CLS
Input"enter any two numbers";A,B
If A<B THEN
PRINT"the smallest no is";A
ELSE
PRINT"the smallest no is ";B
END IF
END
(5)Wap to display middle no among three input numbers
CLS
Input"enter any three numbers";A,B,C
If A>B AND A<C OR A<B AND A>C THEN
Print"the middle no is";A
ELSEIF B>A AND B<C AND B<A AND B>C THEN
Print"the middle no is ";B
ELSE
PRINT"the middle no is";C
END IF
END
(6)Wap to display whether the no is divisible by 13or not
CLS
Input"enter any number";N
If N MOD 13=0 THEN
PRINT"the no is divisible by 13"
ELSE
PRINT"the number is not divisible by 13"
END IF
END
(7)Wap to check whether the no is positive,negative or zero
CLS
Input"enter any number";N
IF N>0 THEN
PRINT"the no is positive"
ELSEIF N<0 THEN
PRINT"the no is negative"
ELSE
PRINT"the no is zero"
END IF
END
(8)Wap to check whether the person can drive or not(age>=16)
CLS
Input"enter age ";A
If A>=16 THEN
Print"the person can drive"
ELSE
Print"the person cannot drive"
END IF
END
(9)Wap to display greatest among three input numbers.
CLS
Input"enter any three numbers";A ,B,C
If A>B AND A>C THEN
Print"the greatest no is";A
ELSEIF B>A AND B>C THEN
Print"the greatest no is";B
ELSE
Print"the greatest no is";C
END IF
END
Comments
Post a Comment