Geography, asked by RajLaxmi3596, 4 months ago

write a program in q basic two number subtract the second number from the first if the first number is greater than the second number or vice versa.
Please don't answer ribish for humanity.​

Answers

Answered by maralsarthak1834
1

Explanation:

Write a program that asks mark in any subject and display the message "Result Pass" if the input number is greater than 40.

CLS

INPUT "Enter marks in computer"; C

IF C> = 40 THEN PRINT "RESULT PASS" ELSE PRINT "RESULT FAIL"

END

2. Write a program that asks any two numbers and displays the greater one.

CLS

INPUT "ENTER FIRST NUMBER";A

INPUT "ENTER SECOND NUMBER";B

IF A>B THEN

PRINT " THE GREATER NUMBER IS";A

ELSE

PRINT "THE GREATER NUMBER IS";B

END IF

END

3. Write a program that checks whether the supplied number is 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

4.Write a program that asks two numbers and displays the difference between greater and smaller number.

CLS

INPUT "ENTER FIRST NUMBER";A

INPUT "ENTER SECOND NUMBER";B

IF A>B THEN

D= A-B

ELSE

D= B-A

END IF

PRINT "DIFFERENCE OF GREATER AND SMALLER NUMBER=";D

END

5.Write a program that asks your age and tells whether you are eligible to vote or not.

CLS

INPUT "ENTER YOUR AGE";A

IF A>=18 THEN

PRINT "YOU ARE ELIGIBLE TO VOTE"

ELSE

PRINT "YOU ARE NOT ELIGIBLE TO VOTE"

END IF

END

6. Write a program to print the smallest among 3 numbers.

CLS

INPUT "ENTER ANY THREE NUMBERS"; A,B,C

IF A<B AND A< C THEN

PRINT "THE SMALLEST NUMBER IS"; A

ELSE IF B<A AND B<C THEN

PRINT "THE SMALLEST NUMBER IS "; B

ELSE

PRINT "THE SMALLEST NUMBER IS";C

END IF

END

Similar questions