Advertisement
khisby

[Soal6]quadrant_coordinates_cartesian

Oct 9th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // Khisby Al Ghofari, 06.2017.1.06852, Kelas B
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int x,y;
  9. string quadrant;
  10. cout << "\n=========================================\n";
  11. cout << "Welcome To \n";
  12. cout << "Application Quadrant Coordinates Cartesian\n";
  13. cout << "===========================================\n \n";
  14.  
  15. cout << "Input the value coordinates X : ";
  16. cin >> x;
  17. cout << "Input the value coordinates Y : ";
  18. cin >> y;
  19.  
  20. if(x > 0 && y > 0 ){
  21. quadrant = "First";
  22. }else if(x < 0 && y > 0 ){
  23. quadrant = "Two";
  24. }else if(x < 0 && y < 0 ){
  25. quadrant = "Three";
  26. }else if(x > 0 && y < 0 ){
  27. quadrant = "Four";
  28. }else if(x == 0 & y == 0){
  29. cout << "Coordinates point at origin";
  30. return 0;
  31. }
  32.  
  33. cout << "Coordinates poin in " << quadrant << " quadrant";
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement