Seperator Function

Seperator Function with For Loop

Implement a function called seperator that, when called, prints 20 hash (#) symbols on a new line.

Example:

This text is above the seperator.
####################
This text is below the seperator.

Hint

Utilize a for loop to print the hash symbols.

Remember to declare your function above main().

Answer

#include <iostream>

void seperator()
{
    std::cout << "\n";
    for (int i = 0; i < 20; i++)
    {
        std::cout << "#";
    }
    std::cout << "\n";
}

int main() 
{
	std::cout << "This text is above the seperator.";
	seperator();
	std::cout << "This text is below the seperator.";
}
Questions