1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stellarik [79]
3 years ago
8

Write a program that takes a point (x,y) from theuser and find where does the point lies. The pointcan

Computers and Technology
1 answer:
agasfer [191]3 years ago
4 0

Answer:

C++ Program .

#include<bits/stdc++.h>

using namespace std;

int main()

{

int x,y;//declaring two variables x and y.

string s;//declaring string s..

cout<<"enter x and y"<<endl;

cin>>x>>y;//taking input of x and y..

if(x>=0 &&y>=0) //condition for 1st quadrant..

cout<<"the point lies in 1st Quadrant"<<endl;

else if(x<=0 &&y>=0)//condition for 2nd quadrant..

cout<<"the point lies in 2nd Quadrant"<<endl;

else if(x>=0 &&y<=0)//condition for 3rd quadrant..

cout<<"the point lies in 3rd Quadrant"<<endl;

else //else it is in  4th quadrant..

cout<<"the point lies in 4th Quadrant"<<endl;

cout<<"enter n to terminate the program"<<endl;

while(cin>>s)//if the user has not entered n the program will not terminate..

{

   if(s=="n")

   {

       cout<<"the program is terminated"<<endl;

       exit(0);

   }

   cout<<"you have not entered n please enter n to terminate the program<<endl;

}

}

Explanation:

The above written program is for telling the point lies in which quadrant.I am first declaring two variables x and y.Then after that taking input of x and y after that checking in which quadrant the point lies.

Taking input of the string s declared earlier for program termination the program will keep running until the user enters n.

You might be interested in
Early photographers take to work with what in order to produce photographs? (Btw this is photography, it just isn't a subject in
Kruka [31]
1, they used to use chemicals.
4 0
3 years ago
Can we change our profile name on here and how
TiliK225 [7]
Only by making a new account
4 0
3 years ago
Read 2 more answers
HAVE A GOOD WEEK OFF PPL
dexar [7]

Answer:

thanks you too mah dude! :)

Explanation:

7 0
2 years ago
The list below shows the number of text messages that five students sent from
liraira [26]

Answer:

Explanation:dhjyfxdhnjfddhjnvcdfg

3 0
3 years ago
What are some of the challenges that could arise from setting up a file management system on a computer?
Arisa [49]
It could fail, it would take a long time setting it up and aslo it could be easily hacked.
3 0
3 years ago
Other questions:
  • In a paragraph of no less than 125 words, explain what netiquette is and how it improves efficiency and productivity in the work
    14·1 answer
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • Write a recursive function, replace, that accepts a parameter containing a string value and returns another string value, the sa
    5·1 answer
  • Why a management-focused program provides a more appropriate learning path for you than a program based heavily on technical con
    8·1 answer
  • What does the launcher button do? (From Microsoft Word 2016)
    6·1 answer
  • A provides legal protection for something an individual has created
    12·1 answer
  • How many Iron molecules are in the compound Fe4O2?
    15·2 answers
  • Does the estimate of a tolerance level of 68.26% of all patient waiting times provide evidence that at least two-thirds of all p
    13·1 answer
  • Use the {blank} to view your presentation the way an audience will see it.
    13·2 answers
  • Write a program that reads 20 integers from the user into an array and uses a function arrayMinimum that accepts an integer arra
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!