Skip to main content

Chef And Operators | CHOPRT

Problem

Chef has just started Programming, he is in first year of Engineering. Chef is reading about Relational Operators.

Relational Operators are operators which check relationship 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 ≤ A, B ≤ 1000000001

Sample 1:

Input

3

10 20

20 10

10 10

Output

<

>

=

Explanation:

In this example, 1 as 10 is lesser than 20


Solution:

#include <iostream>
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;
while(t--){
    int n,m;
    cin>>n>>m;
    if(n>m){
        cout<<">"<<endl;
    }else if(n<m){
        cout<<"<"<<endl;
    }else cout<<"="<<endl;
}
return 0;
}

Comments

Popular posts from this blog

Sum of Digits | FLOW006

  Problem You're given an integer  N . Write a program to calculate the sum of all the digits of  N . Input Format The first line contains an integer  T , the total number of testcases. Then follow  T  lines, each line contains an integer  N . Output Format For each test case, calculate the sum of digits of  N , and display it in a new line. Constraints 1 ≤ � ≤ 1000 1 ≤ T ≤ 1000 1 ≤ � ≤ 1000000 1 ≤ N ≤ 1000000 Sample 1: Input Output 3 12345 31203 2123 15 9 8 Solution: #include <bits/stdc++.h> using namespace std; int main() {     int t;     cin>>t;     while(t--)     {         int n;         cin>>n;         int sum = 0;         while(n!=0)         {             int r = n%10;             sum+= r;           ...

Valid Triangles | FLOW013

  Problem Write a program to check whether a triangle is valid or not, when the three angles of the triangle are the inputs. A triangle is valid if the sum of all the three angles is equal to 180 degrees. Input Format The first line contains an integer  T , the total number of testcases. Then  T  lines follow, each line contains three angles  A ,  B  and  C , of the triangle separated by space. Output Format For each test case, display 'YES' if the triangle is valid, and 'NO', if it is not, in a new line. Constraints 1  ≤   T   ≤  1000 1  ≤   A,B,C   ≤  180 Sample 1: Input Output 3 40 40 100 45 45 90 180 1 1 YES YES NO Solution: #include <iostream> using namespace std; int main() { // your code goes here int t; cin>>t; while(t--){     int a,b,c;     cin>>a>>b>>c;     if((a+b+c)==180)         cout<<"YES"; ...

Add Two Numbers | FLOW001

Problem Problem Statement The task is very simple: given two integers A and B, write a program to add these two numbers and output it. Input Format The first line contains an integer T, the total number of test cases. Then follow T lines, each line contains two Integers A and B. Output Format For each test case, add A and B and display the sum in a new line. Everything your program prints is considered “output”, so if you output some debugging statements like “Please enter T”, this will be considered as part of your answer, and because it does not satisfy the output format, it will be marked wrong, even if your answer is otherwise correct! Constraints 1 ≤ T ≤ 1000 0 ≤ A,B ≤ 10000 Sample 1: Input 3 1 2 100 200 10 40 Output 3 300 50 Solution: #include <iostream> #include <bits/stdc++.h> using namespace std; int main()  {    int t;    cin>>t;    int a,b;    while(t--){     int sum=0;     cin>>a>>...