jeudi 24 octobre 2019

how to return the quadrant inside which a is a given point, without using if statement?

Im doing a c++ homework that asks me to write a program that gets two inputs x and y of a point, and returns the quadrant which the point is inside. we are not supposed to use any if statement and we can just use these operators = + - * / % () and abs function of math.h header file we can't use any other header file except iostream. we can just use the data types of int, double, char, float, bool. can anyone please help me write a mathematical equation or something like that, so i can print the right answer?

Aucun commentaire:

Enregistrer un commentaire