Graderpractice for programmers

Back to 273387 Swift - Functions

X squared

Problem

Write a function called square that takes an Int parameter and returns the square of that number.

Use the following code as a template:

// TODO: write your function here

let inputString = readLine() ?? ""
let input = Int(inputString) ?? 0
let output: Int = square(x: input)
print("\(input) * \(input) = \(output)")

Examples

Input

4

Output

4 * 4 = 16

Input

10

Output

10 * 10 = 100

Input

0

Output

0 * 0 = 0

Submit your solution

swift