Thursday, September 13, 2018

EVEN OR ODD

  • Problem Description

    Somesh and sakthi played one game to find the number is even or not, for that they have designed one coding, using union concept
    track yourself by your code to challenge them for their inputs.

    Input Method

    Integer ranges from 1 to 999

    Output Method

    Print the number is even or not

  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int a;
      scanf("%d",&a);
      if(a%2==0)
        printf("Even");
      else
        printf("Odd");
      return 0;
    }
  • Test Case 1

    Input (stdin)
    2
    
    
    Expected Output
    Even
  • Test Case 2

    Input (stdin)
    5
    
    
    Expected Output
    Odd

No comments:

Post a Comment