Chef And Operators||codechef||beginner solution ||programming info

Chef And Operators

Chef has just started Programming, he is in first year of Engineering. Chef is reading about Relational Operators.
Relational Operators are operators which check relatioship between two values. Given two numerical values A and B you need to help chef in finding the relationship between them that is,

  • First one is greater than second or,
  • First one is less than second or,
  • First and second one are equal.
  •  

    Input

    First line contains an integer T, which denotes the number of testcases. Each of the T lines contain two integers A and B.

    Output

    For each line of input produce one line of output. This line contains any one of the relational operators
    '<' , '>' , '='.

    Constraints

  • 1 ≤ T ≤ 10000
  • 1 ≤ AB ≤ 1000000001
  • Example

    Input:
    3
    10 20
    20 10
    10 10
    
    Output:
    <
    >
    =
    SOLUTION USING C LANGUAGE:-
    #include <stdio.h>
    int main(void) {
        int T,i,A,B;
        scanf("%d\n",&T);
        for(i=0;i<T;i++)
        {
            scanf("%d %d\n",&A,&B);
            if(A>B)
            {
                printf(">\n");
            }
            else if(A<B)
            {
                printf("<\n");
            }
            else
            {
                printf("=\n");
            }
        }
    // your code goes here
    return 0;
    }

    Share:

    No comments:

    Post a Comment

    Translate

    Recommended platforms

    1. codechef
    2. hackerrank
    3. codeforces
    4. leetcode
    5. hackerearth

    Popular Posts

    programming_info. Powered by Blogger.

    Blog Archive

    Recent Posts

    other platforms

    • geeks for geeks
    • w3schools
    • codepen
    • skillshare
    • udemy

    Pages

    reader support Support