Thursday, May 2, 2019

Relational Operator

  • Problem Description

    Get two values as input and print the the equal to not equal to operator according to the input.
  • Test Case 1

    Input (stdin)
    5 5

    Expected Output
    equal
  • Test Case 2

    Input (stdin)
    3 6

    Expected Output
    not equal
Solution

#include <stdio.h>
int main()
{
    int m, n;
    scanf("%d %d", &m, &n);
    if (m == n)
        printf("equal");
    else
        printf("not equal");
  return 0;
}

No comments:

Post a Comment

Parity

Problem Description Ram and Sita playing the parity game. Two types of parity are there. One is odd parity and next is even parity. Ram will...