Saturday, June 23, 2018

Wap to input any numbers and check whether the given number is dovisible by 3 and 7.

CLS
INPUT "Enter any number ";a
IF n MOD 3 =0 AND n MOD 7 = 0 THEN
PRINT " The given number is divisible by 3 and 7 "
ELSE
PRINT " The given number is not divisible by 3 and 7"
END IF
END

WAP to input any number and check whether the given number is positive or negative

CLS
INPUT " Enter any number "; n
IF n > 0 THEN
PRINT " the given number is positive "
ELSEIF n < 0 THEN
PRINT " The given number is negative "
END IF
END

WAP to input any number and display whether it is odd or even

CLS
INPUT " Enter any number "; n
IF n MOD 2 = 0 THEN
PRINT " the given number is even "
ELSEIF
PRINT " The given number is odd "
END IF
END

WAP to enter any two numbers and find the smaller one

CLS
INPUT " Enter any two numbers "; n
IF a < b THEN
PRINT " The smaller number is "; a
ELSEIF a > b THEN
PRINT "The smaller number is "; b
END IF
END

WAPto enter any three numbers and display the middle one

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 number is "; a
ELSEIF b >a AND b <c or b < a AND b > c
ELSE
PRINT " The middle number is "; b
END IF
END

Using SUB ..... END , SUB wap to test whether a user input number is completly divisible by 13 or not

CLS
INPUT " Enter any number "; n
IF n MOD 13 = 0 THEN
PRINT " The given number is divisible by 13 "
ELSE
PRINT " The given number is not divisible by 13 "
END IF
END

WAP to define function procedure which returns whether  the entered number is positive ,negative or zero

CLS
INPUT " Enter any number "; n
IF n > 0 THEN
PRINT " The number is positive "
ELSEIF n < 0 THEN
PRINT  " The given number is negative "
ELSE
PRINT " The number is zero "
END IF
END

WAP to input year and display whether that year is 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 " The given year is leap year "
ELSE
PRINT " The given year is not leap year "
END IF
END

INPUT age of person and find out wether the person is eligible to vote or not

CLS
INPUT " Enter your age "; a
IF a > = 16 THEN
PRINT " you are eligible to vote "
ELSE
PRINT " you are not eligible to vote "
END IF
END

WAP to enter any three number and display the greater one

CLS
INPUT " Enter three numbers "; j,m,s
IF j > m AND j > s THEN
PRINT " The greater number is "; j
ELSEIF m > j AND m > s THEN
PRINT " the greater number is "; m
ELSE
PRINT " the greater number is "; s
END IF
END

No comments:

Post a Comment

MY JOURNEY WITH JAGAT MANDIR SCHOOL

     MY JOURNEY WITH JAGAT MANDIR SCHOOL My journey was started at 9 class with jagat mandir. My journey of was of only two years. It was...