Answer to Question #315217 in C++ for Abby

Question #315217

1. Write a program that will illustrate the use of a function for computing the square of a number. There must be three other functions aside from main(). The First function must be responsible for inputting the data, the second for computation of squares and the third, for Displaying the result. 10 points


1
Expert's answer
2022-03-21T12:38:26-0400
void EnterSqrt(int i)
{
	cout << "Enter square num:" << endl;
	cin >> i;
}
int CompSqrt(int f)
{
	EnterSqrt(f);
	return f * f;
}
void PrintSqrt(int j)
{
	cout << CompSqrt(j) << endl;
}
int main()
{
	int num;
	EnterSqrt(num);
	CompSqrt(num);
	PrintSqrt(num);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog