Complete the code to declare an optional integer variable.
var age: Int[1]In Swift, adding a ? after the type declares an optional variable.
Complete the code to declare an optional string variable named name.
var name: String[1]The ? suffix after String makes name an optional string.
Fix the error in the optional declaration of a Double variable.
var price: Double[1]Use ? to declare price as an optional Double.
Fill both blanks to declare an optional Boolean variable and assign nil.
var isActive: Bool[1] = [2]
Use ? to declare optional and assign nil to show no value.
Fill all three blanks to declare an optional string variable, assign nil, and then assign a value.
var city: String[1] = [2] city = [3]
Declare city as optional with ?, assign nil, then assign a string value.
