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
What will be the output of the following code snippet? token = False while token : print("Hello")
Andrei [34K]

Answer:

Hi!

The correct answer is B.

Explanation:

The code snippet doesn't follow the correct form of writing a while loop, so it will crash when compiles.

One correct form to write the code is:

token = false;

while (token){ <em>// Evaluate token, if true prints else terminates the loop. In this case, token is false so, no output and finish the program.</em>

     print("Hello");

   };

5 0
3 years ago
Applications require you to provide the following basic elements: availability, social security number, and education.
chubhunter [2.5K]
This is true.

Applications simply want the basic information about you. Some other things an application might ask for are references and work experience.
8 0
4 years ago
What is the cheapest type of printer to buy and run?
myrzilka [38]
It depends solely on how much you will use it. For example, laser printers are more suitable for offices, schools, and environments, where the printer is used almost constantly. If it's used a lot, you're probably looking at a laser printer, since the cartridges have a slightly higher price, but a much higher yield. If you can't afford a laser printer, and you're only going to use it at home, you're probably looking at an inkjet. If you need to print off something for school, ask your teacher, or someone that works at your school. Some secondary/high schools might allow you to use their printers at a lower price
7 0
4 years ago
Read 2 more answers
What are the methods or permissions needed to view the passwords for linux and unix?
Greeley [361]
Anybody can read encrypted passwords, they can't decipher them they're encrypted with a one way encryption algorithm.
4 0
3 years ago
A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
uysha [10]

Answer:

Security Tab is the correct answer.

Explanation:

The Security Tab will enable the users to authorize anyone to use that file or directory.Many clients deleted the security tab because After that nobody can alter the security privileges on the device.

  • With the help of the Security tab, we will minimize the ActiveX attacks on Internet Explorer. This option is available in the Internet Options of the dialog box.
  • Other options are incorrect because they are not related to a given scenario.
8 0
3 years ago
Other questions:
  • 1. What is the global marketplace?
    11·2 answers
  • Does anyone have any social media message me
    14·1 answer
  • Businesses finance their operations using a mixture of ______. debt,
    14·1 answer
  • While working a night job at a call center, Eric creates an app called EatOut, which can be used to place orders at restaurants,
    14·1 answer
  • What layer uses the UDP protocol
    6·1 answer
  • Problems of mobile phones
    8·1 answer
  • This road sign means
    14·2 answers
  • 2. Define a function squareArea that computes the area of a square given side length
    14·1 answer
  • How does the autosum command calculate data? Need help ASAP​
    5·1 answer
  • Computer programming 5
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!