Pure Programmer
Blue Matrix


Cluster Map

Project: Aligning Characters and Strings with printf()

Write a program that demonstrates the formatting of characters and strings using printf() and/or sprintf() style output. Your program should reproduce the output shown using the following variables:

  • c1 = "C" (or 'C' in C++)
  • c2 = "-"
  • c3 = 51
  • c4 = 80
  • c5 = 0x4f
  • s = "Boba Fett"

Output
$ swiftc AligningCharactersAndStringsWithPrintf.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution