Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,072 views
in Online Assessments by Expert (108,170 points) | 1,072 views

1 Answer

0 like 0 dislike
Best answer

Can anyone help me with these 3 questions on OA?
image
image

 

image

by Expert (108,170 points)
0 0
Q.3

#include<bits/stdc++.h>
using namespace std;


int main(){

    int x1, y1, x, y;
    cin >> x1 >> y1 >> x >>  y;
    int xdiff = abs(x-x1);
    int ydiff = abs(y-y1);
    if(x == x1 || y == y1)cout << "YES" << endl;
    else if(xdiff == ydiff)cout << "YES" << endl;
    else cout << "NO" << endl;


    return 0;
}

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .