Project work of computer
1. Write a program that asks three numbers and display the greater one.
CLS
INPUT "ENTER ANY THREE NUMBER"; A,B,C
IF A>B AND A>C THEN
PRINT "THE GREATESTNUMBER IS"; A
ELSEIF B>A AND B>C THEN
PRINT "THE GREATEST NUMBER"; B
ELSE
PRINT "THE GREATR NUMBER IS ";CW
ELSE
PRINT "THE GREATR NUMBER IS ";CW
END IF
END
2. Write a program that checks whether the supplied number is even or odd.
CLS
INPUT "ENTER FIRST NUMBER"; A
IF N MOD 2 = 0 THEN
PRINT "EVEN NUMBER'"
ELSE
PRINT "ODD NUMBERS"
END IF
END
3.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
4. WAP to ask whether the given number is divisible by 7 and 13 or not.
CLS
INPUT "ENTER ANY NUMBER"N
IF N MOD 7=0 AND N MOD 13=0 THEN
PRINT "THE NO.IS DIVISIBLE BY 7 AND 13"
ELSE
PRINT "THE NUMBER IS NOT DIVISIBLE BY 7 AND 13"
END IF
END
5.WAP to check whether the no. is positive ,negative and zero
CLS
INPUT "ENTER ANY NUMBER "N
IF N<OTHEN
PRINT "NUMBER IS POSITIVE"
ELSE IF N<O THEN
PRINT "NUMBER IS NEGATIVE"
ELSE
PRINT "NUMBER IS ZERO"
END IF
END
6.wap to print smallest no.among two input number
CLS
INPUT "ENTER ANY TWO NUMBER ";A,B
IF A<B THEN
PRINT "THE SMALLEST NO. IS ";A
ELSE
PRINT "THE SMALLEST NO. IS ";B
END IF
END
7.WAP to asks any three numbers and displey the middle mumber.
CLS
INPUT "ENTER ANY THRE NUMBER ";A,B,C
IF A>B AND A<C OR A<B AND A>C THEN
PRINT "THE MIDDLE NO. IS ";A
IF B>A AND B<C OR B<A AND B>C THEN
PRINT "THE MIDDLE NO. IS ";B
ELSE PRINT "THE MIDDLE NO. IS ";C
END IF
END
8.WAP to check whether the no. is negative or positive
CLS
INPUT "ENTER ANY NUMBER ";N
IF N>O THEN
PRINT 'THE NUMBER IS POSITIVE"
ELSE
PRINT "THE NUMBER IS NEGATIVE "
END IF
END
9. 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
10. Write a program that asks your age and tells whether you are eligible to drive or not.
CLS
INPUT "ENTER YOUR AGE="; A
IF A>= 16 THEN
PRINT "YOU ARE ELIGIBLE TO DRIVE"
ELSE
PRINT "YOU ARE NOT ELIGIBLE TO DRIVE"
END IF
END
No comments:
Post a Comment
beautiful