First term computer project

by - June 23, 2018

1.Wap to check whether the number 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 "Number is divisible by 3 and 7 "
ELSE
PRINT "Number is not divisible by 3 and 7"
END IF
END

2.Wap  to  check whether the given no. is positive ,negative and zero.

      CLS
       INPUT"Enter any number";N
       IF  N MOD 2=0 THEN
       PRINT"positive number"
       ELSEIF  N‹0 THEN
       PRINT"Negative number"
       ELSE
       PRINT"The no. is zero"
       END IF
        END

3.WAP  to check the given number is odd or even.

CLS
INPUT"Enter any number";N
IF N MOD 2=0 THEN
PRINT"The number is even"
ELSE
PRINT"The number is odd"
END IF
END


4.WAP to display smaller one of two numbers.

CLS
INPUT"Enter any two numbers";a,b
IF a›b THEN
PRINT"The smallest number is";a
ELSE
PRINT"The smallest  number is ";b
END IF
END

5.WAP to display the middle number of three 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 ";b
ELSE
PRINT"The middle no. is ";c
END IF
END


6. WAP  to check whether the  number is divisible by 13 or not.
CLS
INPUT"Enter any number";N
IF N MOD 13=0 THEN
PRINT"Number is divisible by 13"
ELSE
PRINT"Number is not divisible by 13"
END IF
END



7.WAP to check whether the no. is positive or  negative.

CLS
INPUT"Enter any number";N
IF N›0 THEN
PRINT "No. is pisitive"
ELSEIF N‹0 THEN
PRINT"No. is Negative"
ELSE
PRINT"No. is zero"
END IF
END


8.WAP to display that year is a leap year or not.

CLS
INPUT"Enter year";y
IF y MOD 4 =0 AND y MOD 100‹›0
OR y MOD 400=0 THEN
PRINT"Leap year"
ELSE
PRINT"The year is not leap year"
END IF
END


9.WAP  to check whether the person is eligible to drive or not.

CLS
INPUT"Enter age";a
IF a›=16 THEN
PRINT"you  are eligible to drive"
ELSE
PRINT"you  are not eligible to drive"
END IF
END



10.WAP to display greatest among three 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


You May Also Like

0 comments