Chemistry, asked by mayurpatilp56h, 5 days ago

एका राष्ट्रामध्ये अनेक राज्य असू शकतात.​

Answers

Answered by srivastavaanusha63
0

Answer:

n MOD 2 = 0 THEN

PRINT "Input Number is Even"

END IF

IF n MOD 2 = 1 THEN

PRINT "Input Number is Odd"

END IF

END

Program using Select Case

CLS

INPUT "Enter a Number: ", n

SELECT CASE (n MOD 2)

CASE 1

PRINT "Input Number is Odd"

CASE 0

PRINT "Input Number is EVEN"

END SELECT

END

Program using subroutine

DECLARE SUB odd_even

CLS

odd_even

END

SUB odd_even

INPUT "Enter a Number: ", n

IF n MOD 2 = 0 THEN

PRINT "Input Number is Even"

ELSE

PRINT "Input Number is Odd"

END IF

END SUB

Program using subroutine – Passing input as an argument

DECLARE SUB odd_even(n)

CLS

INPUT "Enter a Number: ", n

odd_even(n)

END

SUB odd_even(n)

IF n MOD 2 = 0 THEN

PRINT "Input Number is Even"

ELSE

PRINT "Input Number is Odd"

END IF

END SUB

Program using Function

DECLARE FUNCTION odd_even()

CLS

odd_even()

END

FUNCTION odd_even()

INPUT "Enter a Number: ", n

IF n MOD 2 = 0 THEN

PRINT "Input Number is Even"

ELSE

PRINT "Input Number is Odd"

END IF

END FUNCTION

Program using Function – Passing input as an argument

DECLARE FUNCTION odd_even(n AS INTEGER)

CLS

INPUT "Enter a Number: ", n

r = odd_even(n)

END

FUNCTION odd_even(n AS INTEGER)

IF n MOD 2 = 0 THEN

PRINT "Input Number is Even"

ELSE

PRINT "Input Number is Odd"

END IF

END FUNCTION

Program using Function – Passing input as an argument and returning True/False

DECLARE FUNCTION odd(n AS INTEGER)

CLS

INPUT "Enter a Number: ", n

r = odd(n)

IF r = 0 THEN

PRINT "Input Number is Even"

ELSE

PRINT "Input Number is Odd"

END IF

END

FUNCTION odd(n AS INTEGER)

odd = n MOD 2

END FUNCTION

Similar questions