Introduction To Computer Science Lab - CSE 112
Introduction To Computer Science Lab - CSE 112
Problem 1: (PT - 5) Categorize a Number as Positive, Negative, or Zero and Determine Its
Parity
Input: A single integer.
Output:
If the number is positive, print "The number is positive and even" or "The number is positive
and odd" based on its parity.
If the number is negative, print "The number is negative and even" or "The number is
negative and odd" based on its parity.
If the number is zero, print "The number is zero and even".
Example:
Input: -5
Output: The number is negative and odd
Input: 4
Output: The number is positive and even
Create a function called find_largest that takes two integers as parameters and returns the
larger of the two.
Use the function in the main program to determine and print the result.
Example:
Input:
7 15
Output:
The largest number is 15