Question: C++ programming, all in one main.cpp file :) Write a function called isPerfectSquare that takes an integer and returns true if the given parameter is
Write a function called isPerfectSquare that takes an integer and returns true if the given parameter is a perfect square. A perfect square is the product of a rational number multiplied by itself, such as 9 (for 3 3), 16 (or 4 4), 25 (5 5) bool isPerfectSquare (int n) 2. Write a function called checkPerfectsquares that does not take any parameters and prints all the perfect squares between 1 and 100 (inclusive). checkPerfectsquares has to call isPerfectSquare function. void checkPerfectSquares () Output 1 is a perfect square 4 is a perfect square 9 is a perfect square 100 is a perfect square 3.Write a function called perfectSquares that does not take any parameters and prints all the perfect squares between 1 and 100 (inclusive). perfectSquares should not call isPerfectSquare function, instead it should have two for loops. The inner loop should print the output and then use break to terminate the inner loop. void perfectSquares The below function imperfectNumbers does not take any parameters and prints all the numbers from 1 to 10. Add a continue statement inside an if, so that the cout statement is skipped when the number is a perfect square. You should call isPerfectsquare as the condition of the if statement. void imperfectNumbers) for (int n 1; 10; ++n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
