Find bigger of 4 numbers when other 3 are equal in C

int main()
{ 
int a, b, c, d, K, M;
   printf(“Enter 4 numbers (A, B, C, D) : \n”) ;
   scanf(“%d%d%d%d”, &a, &b,&c, &d) ;
   K=a+b;
   M=c+d;
   printf(“\nThe bigger number is “) ;
if(K>M)
       (a>b) ?printf(“A. \n”) : printf(“ B.\n”) ;
else
       (c>d) ?printf(“C. \n”) : printf(“ D.\n”) ;
   return 0;
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.