212k views
5 votes
Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to standard output a single line (terminated by a new line character) consisting of 5 periods.

1 Answer

2 votes

Answer:

The answer to this question can be given as:

Function definition:

void printDottedLine() //define function printDottedLine().

{

//function body.

cout << ".....\\"; //message

}

Step-by-step explanation:

In above c++ programming language we define a function definition that can be explained as follows:

  • Firstly we define a function that is printDottedLine() function.
  • This function does not return any value because its return type is void.
  • The cout function prints the output in a single line which is terminated by a new line character that consisting of 5 periods i.e dot.
User John Blackbourn
by
8.1k points