@donbock
I only need to go to up to the integer 20.
@zmbd
Its a class assignment
User Profile
Collapse
-
I know how to find perfect squares I just don't know how to write an if statement that can check the sums of x and y, and produce either a false or true statement.
This is what I need to do: I have to write a program that gets two numbers between 1-20, square both of them to 2nd power, and say whether there sums is a perfect square.
For example 3^2+4^2= 25. 25 is a perfect square so that would be true.Leave a comment:
-
What do you mean code tags. I never used this site before. Sorry.Leave a comment:
-
IF Statements
Heres a partial view of my code.
Code:cout << "sqrt(x*x + y*y) = " << "sqrt(" << x*x << " + " << y*y << ") = " << sqrt(x*x+y*y) << endl; if(/*test for perfect square*/) cout << true; else cout << false; return 0; }
No activity results to display
Show More
Leave a comment: