Swift Program to demonstrate typewrapping integer value

Program

var a: Int = 10 //Constant. Cannot be nil
var b: Int! = 20 //Type here is Implicitly Unwrapped Optional Int
var c: Int? = 30 //Type here is Optional Int
var x = a + b
print("Value of x: \(x)")
// var y = a + c is not possible because we need to wrap it with !
var y = a + c!
print("Value of y: \(y)")
if let c_val = c {
    let z = a + c_val
    print("Value of z: \(z)")
}

Output

$ swift type_wraps_int_demo.swift 
Value of x: 30
Value of y: 40
Value of z: 40