Ask Question

Write the function prototype for a function called showSquare. The function should have a single parameter variable of the int data type and a return type of void.

+1
Answers (1)
  1. 13 August, 01:19
    0
    void showSquare (int param) {

    }

    Explanation:

    In C+ + programing language, this is how a function prototype is defined.

    The function's return type (In this case Void)

    The function's name (showSquare in this case)

    The function's argument list (A single integer parameter in this case)

    In the open and closing braces following we can define the function's before for example we may want the function to display the square of the integer parameter; then a complete program to accomplish this in C+ + will go like this:

    #include

    using namespace std;

    void showSquare (int param);

    int main ()

    {

    showSquare (5);

    return 0;

    }

    void showSquare (int param) {

    int square = param*param;

    cout<<"The Square of the number is:"<
    cout<
    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the function prototype for a function called showSquare. The function should have a single parameter variable of the int data type ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers