by Dinesh Thakur Category: C Programming (Pratical)

Let us use variables a, b and c (all of type int) to represent three integer numbers and variable max (also of type int) to represent the maximum of them.

It first accepts the values of variables a, b and c. To determine the maximum number, the larger number of a and b is first assigned to max using the if-else statement. Then the larger of variables max and c, which is the maximum of the three given numbers, is determined using a simple if statement. Finally, the value of max is printed. The program is given below.  

void main()
       int a,b,c;
       printf("Enter the Value of a = ");
       printf("Enter the Value of b = ");
       printf("Enter the Value of c = ");
       if (a>b&&a>c)
                 printf("a is Greater ");
      else if(b>a&&b>c)
                   printf("b is Greater");
                   printf("c is Greater");

C Program to Find the Greatest Between 3 Number

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.