Exercises

Swift Programming Basics

Build confidence in Swift programming fundamentals with this beginner-friendly quiz. Test your knowledge of Swift file types, variable and constant declarations, printing output, defining functions, value types, string concatenation, error handling, control flow statements, and optional types. Whether you are preparing to develop iOS apps or reviewing the core Swift language syntax, these questions provide a quick way to check your understanding of essential concepts.

Answer the questions below and check the explanation for each answer.

0/10 answered

  1. 1

    What is the main file type used for Swift code?

  2. 2

    Which keyword is used to define a variable in Swift?

  3. 3

    What is the correct way to declare a constant in Swift?

  4. 4

    Which function is used to print messages in Swift?

  5. 5

    How do you define a function in Swift?

  6. 6

    What is the default value type in Swift?

  7. 7

    Which symbol is used for string concatenation in Swift?

  8. 8

    What keyword is used to handle unexpected errors in Swift?

  9. 9

    Which of these is a control flow statement in Swift?

  10. 10

    How do you declare an optional type in Swift?

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate