Write a C program to find maximum between three numbers.
- /*Write a C program to find maximum between three numbers */
- #include<stdio.h>
- int main ()
- {
- int a, b, c, max;
- printf("find maximum between three numbers: ");
- scanf("%d %d %d", &a, &b, &c);
- if( a > b){
- max = a;
- }
- if( b > a){
- max = b;
- }
- if( b > c){
- max = b;
- }
- if( c > a){
- max = c;
- }
- if( a > c ){
- max = a;
- }
- if ( c > b){
- max = c;
- }
- printf("The maximum number is: %d\n", max);
- return 0;
- }