Computer Science, asked by imstoopid, 5 months ago

Given any ordered pair(x,y), generate a program using python that tells you in which quadrant (or on which axis) the point lies. Hence, x and y are real numbers.
PYTHON only please.​

Answers

Answered by Anonymous
13

Answer:

// CPP program to check quadrant

#include <bits/stdc++.h>

using namespace std;

// Function to check quadrant

void quadrant(int x, int y)

{

if (x > 0 and y > 0)

cout << "lies in First quadrant";

else if (x < 0 and y > 0)

cout << "lies in Second quadrant";

else if (x < 0 and y < 0)

cout << "lies in Third quadrant";

else if (x > 0 and y < 0)

cout << "lies in Fourth quadrant";

else if (x == 0 and y > 0)

cout << "lies at positive y axis";

else if (x == 0 and y < 0)

cout << "lies at negative y axis";

else if (y == 0 and x < 0)

cout << "lies at negative x axis";

else if (y == 0 and x > 0)

cout << "lies at positive x axis";

else

cout << "lies at origin";

}

// Driver code

int main()

{

int x = 1, y = 1;

// Function call

quadrant(x, y);

return 0;

}

Answered by rabbit02022010
0

Answer:

I'm extremely sorry to spam please report me as I have spamed I just wanted to tell u that u have given me right answer please solve the other question that I have posted as I'm really struggling to find it's answer.

if u would answer my question I'd feel honored.

Explanation:

thanks for the answer it was extremely helpful (in attachment)

my question is in second attachment.id be honored if u solve it please.

Attachments:
Similar questions