In this C program, we will find maximum of three numbers using conditional operator.

#### Required Knowledge

**Algorithm to find maximum of three numbers using conditional operator**

*Let A, B and C are three numbers.*

- We will first find the largest of A and B. Let it be X.
- Then we will compare X with third number C to get the overall largest number.

## C program to find maximum of three numbers using conditional operator

#include <stdio.h> int main() { int a, b, c, max; printf("Enter Three Integers\n"); scanf("%d %d %d", &a, &b, &c); max = (a > b)?((a > c)?a:c):((b > c)?b:c); /* Print Maximum Number */ printf("Maximum Number is = %d\n", max); return 0; }Output

Enter Three Integers 9 1 4 Maximum Number is = 9

**Related Topics**