C Program to Calculate Maximum of three numbers

Spread the love

Description: 

This program accepts Three integers as input and calculates the Maximum number.

Program :

  1. #include<stdio.h>
  2. int main()
  3. {
  4.    int a,b,c,max;
  5.    printf(“Enter Three numbers : “);
  6.    scanf(“%d%d%d”,&a,&b,&c);
  7.  
  8.    if( (a>b) && (a>c) )
  9.    {
  10.       max = a;
  11.    }
  12.    else if(b>c)
  13.    {
  14.       max = b;
  15.    }
  16.    else
  17.    {
  18.       max = c;
  19.    }
  20.  
  21.    printf(“Max of %d, %d and %d is : %dn,a,b,c,max);
  22.    return 0;
  23. }

Output :

Related Programs:


Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply