Function that has three inputs which are integers

Assignment Help C/C++ Programming
Reference no: EM13695867

Prepare a C++ program to find the desired result

Program: Write a C++ function that has three inputs which are integers. The function returns true if the first number raised to the power of the second number equals the third number.

You need to see the entire code and it must run please.

This is what I have and I am getting an error when I run the code and I cannot figure out how to fix it. Below is my code, please clarify to me where I am wrong. This is totally new to me and I am need all the help I can get!! Thanks in advance!


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int x;
int y;
int z;
bool check;

cout <<"Enter a number for x, y, z\n";
cin>> x, y, z;

check = (pow(x, y) == z);

if (check == true)

cout << "True";

else

cout << "False";


cin.ignore(2);
return 0;
}

bool check (int x, int y,int z)
{
if (pow(x, y) == z)
return true;
else
return false;
}

You need to make well-formed and clean code. You should not copy and paste the code from other source.

Reference no: EM13695867

Questions Cloud

Create a website for a fashion designer : Imagine that an associate of yours just designed a table with captions outside the table's borders. The font on the Website is black, and the text inside the table is red.
Draw the recursive process of quicksort : Draw the recursive process of Quicksort and Mergesort for sorting the sequence {5, 1, 2, 9, 7}. You will get a recursion tree for Quicksort and Mergesort respectively. What are their depths?
Create a new web page : Create a new web page with one image and corresponding JavaScript file. You will teach the image to play the "keep away" game. Give the image an ID so that your script can find it with the getElementById method.
For what value is n is 10n : Show how to do this so please show the work involved.
Function that has three inputs which are integers : Write a C++ function that has three inputs which are integers. The function returns true if the first number raised to the power of the second number equals the third number.
Determine the error in your above estimate : Determine the error in your above estimate, and use that value to estimate the error you'd expect for
What is the logarithm base-2 of zero : How would you advise your coworker on which algorithm to choose - What is the logarithm base-2 of zero? of one?
Calculate the wait time between two iterations : Question on Retry factor and Retry and Retry Interval, practical question is asked on this to calculate the wait time between two iterations?
How long does it take the man to reach his in-laws : How long does it take the man to reach his in-laws- A man begins a car trip to visit his in-laws. The total distance is 60 miles, and he starts off at a speed of 60 miles per hour. After driving exactly 1 mile, he loses some of his enthusiasm for t..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that fills in an array

Write a program that fills in an array, a, of 25 integers where each element contains the sum of all the previous elements plus 1, e.g., a[0] is 1 and a[3] is equal to a[0] + a[1] + a[2] + 1.

  Write a program for a college''s admissions office

Write a program for a college's admissions office. Create variables that store a numeric high school grade point average andan admission test score.Print the message "Accept" if the studenthas any of the following:

  Write statements that assign random integers to the variable

Write statements that assign Random integers to the variable n in the following ranges.

  Computes the area of a rectangle

Create an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid.

  Calculate the hypotenuse of a triangle

Pythagorean Theorem.  Use the Pythagorean Theorem to calculate the hypotenuse of a triangle given two sides.  Suppose the input sides can make a triangle.

  The knight''s tour problem

The knight's tour problem is as follows: given an initial position for a single knight on an otherwise empty chessboard, find a sequence of 64 moves that will make the knight visit every square on the board exactly once

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

  Calculate the volume flow rate in cubic feet

Write a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second. The formula for the flow rate is given by: Where area = ?d^2 / 4 equation in sq..

  Implement function types that takes no input

Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double.

  Write a program that generates all the factors of a number

Write a program that generates all the factors of a number entered by the user. For instance, the number 12 has the factors 2 * 2 * 3.

  Machine that i would like to know

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..

  C++ pointer function synopsis

C++ pointer Function Synopsis: char *amonthLess(char *dateString) Description: Variable dataString is a valid date in a form of mm/dd/yyyy Given the above information, write a main() program that asks a user to enter a date in a form of mm/dd/yyyy..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd