Saturday, August 18, 2018

BIGGEST OF THREE NUMBERS

  • Problem Description

    Find the biggest of 3 numbers using pointer
  • CODING ARENA
  • #include <stdio.h>
    #include<math.h>
    int main()
    {
      int a,b,c;
      scanf("%d%d%d",&a,&b,&c);
      if(a>b)
        printf("%d",a);
      else if(b>c)
        printf("%d",b);
      else
        printf("%d",c);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    23 45 10
    
    
    Expected Output
    45
  • Test Case 2

    Input (stdin)
    100 80 10
    
    
    Expected Output
    100

No comments:

Post a Comment