Question Set - If - Else
Question Set - If - Else
2. Take values of length and breadth of a rectangle from user and check if it is square or
not.
6. A student will not be allowed to sit in exam if his/her attendance is less than 75%. Take
following input from user:
Number of classes held
Number of classes attended.
and print percentage of class attended and whether student is allowed to sit in exam or
not.
7. Ask user to enter age, gender (M or F), marital status ( Y or N ) and then using
following rules print their place of service.
If employee is female, then she will work only in urban areas.
If employee is a male and age is in between 20 to 40 then he may work in anywhere
If employee is male and age is in between 40 t0 60 then he will work in urban areas
only.
And any other input of age should print "ERROR".
10. Write a program to check whether a number (accepted from user) is positive or
negative.
11. Write a program that asks the number between 1 and 10. If the number is out of range
the program should display "invalid number".
12. Write a program that accepts the temperature in degree Celsius of water from user and
check whether it is boiling or not (boiling point of water in 100 degrees Celsius).
14. Accept the marks of English, Math and Science, Social Studies Subject from the user and
display the stream allotted according to following rules:
a. All Subjects more than 80 marks --> Science Stream
b. English >80 and Math, Science above 50 --> Commerce Stream
c. English > 80 and social studies > 80 --> Humanities