
Decision Statements II-83
if(z>y)
printf("z=%d\n",z);
else
printf("y=%d\n",y);
}
}
OUTPUT:
Enter three numbers x, y, z : 10 20 30
The largest out of three numbers is :z=30
Explanation: This is also an example of nested ifs. When the if statement satisfies the condition,
control passes to another if statement block. Three numbers are entered through keyboard. The first if
statement compares the first number with the second number. If the condition is true, the block following
the first if statement executes. Inside the block, if statement checks whether the first number is larger
than the third number. If yes, then, the largest number is the f ...