You are on page 1of 1

‘if – else‘ Assignment 1

Solve the following programs in your notebooks.


Paste the execution screenshots in this document and turn in by 3.5.22 6:00 pm
1. WAP to input a number. Check and print if it is even or odd.
2. WAP to input a number. Check and print if it is positive or negative.
3. WAP to input percentage of a student for all who score 40 and above print “PASS” or
print “FAIL”.
4. WAP to input length and breadth of a four sided figure, if they are equal print “SQUARE”
otherwise print “RECTANGLE”.
5. WAP to input age of a student, if it is 18 or above print “ADULT” otherwise print “NOT
AN ADULT”.
6. WAP to input angle of a triangle, if it is less than 90 print “ACUTE ANGLE” else print
“OBTUSE ANGLE”.
7. WAP to input 2 numbers if the 1st number is smaller than the 2nd number print their sum
otherwise print their product.
8. WAP to input 3 angles of a triangle check if the triangle is possible or not [a+b+c=180]
9. WAP to input a character. If it is uppercase ‘U’ print “LAST UPPERCASE VOWEL” else
print “NOT THE LAST UPPERCASE VOWEL”
10. WAP to input marks in 3 subjects. If the total marks are more than 90 then print
average of the marks else print the percentage of marks.

You might also like