Write the definition of a method printDottedLine, which has no parameters and doesn’t return anything. The method prints to standard output a single line (terminated by a newline) consisting of five periods.

2
Write the definition of a method printDottedLine, which has no parameters and doesn’t return anything. The method prints to standard output a single line (terminated by a newline) consisting of five periods.

LANGUAGE: JAVA

CHALLENGE:

Write the definition of a method printDottedLine, which has no parameters and doesn’t return anything. The method prints to standard output a single line (terminated by a newline) consisting of five periods.

SOLUTION:

void printDottedLine(){
   System.out.println(".....");
}

2 comments

  • Duane Dickhut says:

    LANGUAGE: C++

    CHALLENGE:

    Write the definition of a method printDottedLine, which has no parameters and doesn’t return anything. The method prints to standard output a single line (terminated by a newline) consisting of five periods.

    SOLUTION:

    void printDottedLine(){
    cout << "…..\n";
    }

  • kirk says:

    for C

    void printDottedLine(void)
    {
    printf(“…..\n”);
    }

Add comment