Practical 2
Practical 2
41
Experiment no. 2
Code:
1: Program to Check even or odd no.
Output:
Enter a Number :45
Number Entered Is Positive
Output:
Enter 1st Number :7
Enter 2nd Number :45
Enter 3rd Number :35
Num 2 is greater
3: Program to Check Grade
if Grade >= 75 :
print("First Class Distiction")
Output:
Enter your grade :89
First Class Distiction
4: Program to Check the no is Even or Odd
if num % 2 ==0 :
print("Num is Even ")
else :
print("Num is Odd")
Output:
if Year % 4 == 0:
print("It's a Leap Year ")
else :
print("It's not a Leap Year")
output:
Enter a Year :2005
It's not a Leap Year