// Greatest of Three Numbers in C using If Statement
// It's the main function of the program
int main()
{
int num1, num2, num3;
// Step-1 Enter three integer values
printf("INPUT-1: ");
scanf("%d", &num1);
printf("INPUT-2: ");
scanf("%d", &num2);
printf("INPUT-3: ");
scanf("%d", &num3);
// Step-2 Check if num1 is greater than both num2 and num3, num1 is the greatest
if (num1 >= num2 && num1 >= num3)
{
printf("\nGreatest Number :: %d", num1);
}
// Step-3 Check if num2 is greater than both num1 and num3, num2 is the greatest
if (num2 >= num1 && num2 >= num3)
{
printf("\nGreatest Number :: %d", num2);
}
// Step-4 Check if num3 is greater than both num1 and num2, num3 is the greatest
if (num3 >= num1 && num3 >= num2)
{
printf("\nGreatest Number :: %d", num3);
}
return 0;
}