Create a Multiplication Table for 5 (from 1 to 10)
- In Unity, create a new C# script called MultiplicationTable.
- Attach the script to an empty GameObject in your scene.
- Define the Multiply Function: Define a function called Multiply that takes two integers and returns an integer. The function should multiply them, and return the result.
- In the Start method, create a for loop to generate a multiplication table for the number 5, iterating from 1 to 10. For each iteration, call the Multiply function with the current loop index (from 1 to 10) and the number 5. Log the result to the Unity Console in the format: "5 x 1 = 5", "5 x 2 = 10", etc. Expected Output: When you run the game, the Unity Console should display the 5’s multiplication table: 5 x 1 = 5 5 x 2 = 10 ... 5 x 10 = 50