Swift program to print the character corresponding ASCII value

bookmark


import Swift;

var ascVal = 65;

// Convert Int to a UnicodeScalar.
var char = UnicodeScalar(ascVal)!

print("Char: ",char);

 


Output:

Char:  A

...Program finished with exit code 0
Press ENTER to exit console.