We've wrritten this code:
void mainFunction() {
System.out.println("Hello AlgoCademy!");
System.out.println("Coding is amazing!");
System.out.println("Functions are so useful!");
System.out.println("Hello AlgoCademy!");
System.out.println("Coding is amazing!");
System.out.println("Functions are so useful!");
System.out.println("Hello AlgoCademy!");
System.out.println("Coding is amazing!");
System.out.println("Functions are so useful!");
}
Write the same code in a better way by creating and calling a function printMessages()
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
