 ### Program to find the quadrant in which the given coordinates lie ### Select Articles

Program to find the quadrant in which the given coordinates lie

Program to find the quadrant in which the given coordinates lie is discussed here. Input a point from the user and find the quadrant in which the given coordinates lie.

DESCRIPTION

if it is in center display Origin

INPUT FORMAT:

Input consist of 2 integers.

First input corresponds to x co-ordinate.

Second input corresponds to y co-ordinate.

SAMPLE INPUT AND OUTPUT:

Input:

5

6

Output:

Program to find the quadrant in which the given coordinates lie

C

// C program to find the quadrant in which the given coordinates lie

#include

int main()

{

//Fill the code

int a,b;

scanf(“%d %d”,&a,&b);

if(a > 0 && b > 0)

else if(a < 0> 0)

else if(a < 0>

else if(a > 0 && b < 0>

else

printf(“Origin”);

return 0;

}

C++

// C++ program to find the quadrant in which the given coordinates lie

#include

using namespace std;

int main()

{

//Fill the code

int a,b;

cin >> a >> b;

if(a > 0 && b > 0)

else if(a < 0> 0)

else if(a < 0>

else if(a > 0 && b < 0>

else

cout << “Origin”;

return 0;

}

JAVA 8

// Java program to find the quadrant in which the given coordinates lie

import java.util.*;

public class Main

{

public static void main(String[] args)

{

Scanner sc = new Scanner(System.in);

int a,b;

a = sc.nextInt();

b = sc.nextInt();

if(a > 0 && b > 0)

else if(a < 0> 0)

else if(a < 0>

else if(a > 0 && b < 0>

else

System.out.print(“Origin”);

}

}

PYTHON 3

# Python program to find the quadrant in which the given coordinates lie

a = int(input())

b = int(input())

if(a > 0 and b > 0):

elif(a < 0> 0):

elif(a < 0>

elif(a > 0 and b < 0>