C Program to Find the Largest Number Among Three Numbers - CodeTextPro | Free Web Tutorial

Codetextpro Provides free Web tutorial, HTML, CSS, C, C++, Java, JavaScript, PHP, MySql, Python, Program, Programming Notes, Programming Questions and more.

Programming

Wednesday, February 6, 2019

C Program to Find the Largest Number Among Three Numbers

In this C Program, you will learn how to find the largest number among three numbers.


Largest Number Among Three Number in C


This program uses if - else statement to find the largest number.


#include<stdio.h>
main()
{
 int a,b,c;
 printf("Enter three number:\n");
 scanf("%d%d%d",&a,&b,&c);
 if((a>b)&&(a>c))
     {
      printf("The gretest number is:  %d",a);
  }
  else if((b>a)&&(b>c))
  {
   printf("The gretest number is:  %d",b);
  }
  else
  {
   printf("The gretest number is:  %d",c);
  }
  getch();
}








1 comment: