A statement that contains other statements is called a compound statement. to perform more complex checks if statements can be nested that is can be placed one inside the other. in such a scase the inner if statements is the statement part of the outer one nested if statements are used to check if more than one condition is satisfied.
Q.) W.A.P to print the greater number using simple if-else statement.
a=int(input("Enter first Number"))
b=int(sinput("Enter Second Number"))
if a>b:
if a>c:
print(“Max =%d”,a);
else:
print(“Max = %d”,c);
else:
if b>c:
print(“Max =%d”,b);
else:
print(“Max=%d”,c);
Output
enter three numbers:3 4 5
Max= 5