func pow (_ base:Int, _ power:Int) -> Int {
  var answer : Int = 1
  for _ in 0..<power { answer *= base }
  return answer
}


var a : Int = 3
var b : Int = 2
var c  = a ^ b
print("Sum of x and y = ",  pow(a,b))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: