C Program to Find the Largest Number Among Three Numbers

Program : -


#include<stdio.h>
#include<conio.h>
void main()
{
      float a, b, c;
      printf("Enter three numbers: ");
      scanf("%f %f %f", &a, &b, &c);
      if (a>=b)
      {
          if(a>=c)
            printf("Largest number = %.2f",a);
          else
            printf("Largest number = %.2f",c);
      }
      else
      {
          if(b>=c)
            printf("Largest number = %.2f",b);
          else
            printf("Largest number = %.2f",c);
      }
      getch();
}



Output : -


Enter three numbers: 12.2 13.452 10.193 Largest number = 13.45