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
Which file extension indicates a Microsoft Excel document?
VikaD [51]
XLSX is the extension for an excel document.

3 0
3 years ago
What is the best response to cyberbullying?
astra-53 [7]
Answer is C





Braine list please:)
5 0
3 years ago
Read 2 more answers
A shuffle of two strings X and Y is formed by interspersing the characters into a new string, keeping the characters of X and Y
levacccp [35]

Shuffle (A[1..m], B[1..n], C[1..m+n]):

Shuf[0, 0] ← True

for j ← 1 to n

Shuf[0, j] ← Shuf[0, j − 1] ∧ (B[j] = C[j])

for i ← 1 to n

Shuf[i, 0] ← Shuf[i − 1, 0] ∧ (A[i] = B[i])

for j ← 1 to n

Shuf[i, j] ← False

if A[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i − 1, j]

if B[i] = C[i + j]

Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i, j − 1]

return Shuf[m, n]

The algorithm runs in O(mn) time.

3 0
3 years ago
How did people figure qwerty keyboard set up, instead of the abcdef setup?
marissa [1.9K]

Answer:

They are arranged randomly because manual typewriters tended to jam if the user typed too fast - therefore the arrangement was intended to slow early typists down.

Explanation:

3 0
2 years ago
What is the basic purpose of the osi physical layer?.
andrew11 [14]

The basic purpose of the osi physical layer: To coordinates rules for transmitting bits.

<h3>Osi physical layer</h3>

OSI Physical layer is important as it help to coordinates the  rules for transmitting bits and it is responsible for transmitting bits from one device to another or from one computer to another.

In order for the transmission to successful take place in OSI Physical layer the bits must be encoded into signals in which the bits are then transmitted across a communication channel.

Inconclusion the basic purpose of the osi physical layer: To coordinates rules for transmitting bits.

Learn more about Osi physical layer here:brainly.com/question/24793290

3 0
2 years ago
Other questions:
  • What three characteristics of a function are described in an IPO chart? What is performed at each characteristic?
    12·1 answer
  • Sam wanted to open a file that he saved yesterday. Which component inside the computer stores this file? the hard drive the fax
    13·2 answers
  • I have a question about a hotel tv:
    10·1 answer
  • You should use html elements instead of server controls when
    11·1 answer
  • Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe
    13·1 answer
  • Why is removing presentation-oriented markup from one's html document considered to be a best practice?
    14·1 answer
  • Write a program that tells what coins to give out for any amount of change from 1
    6·1 answer
  • __________ can be used to replace internal network addresses with one or more different addresses so the traffic that actually t
    9·1 answer
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Explain the concept of conditional formatting​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!