Swift Basic Programming Test

10 Questions | Total Attempts: 2125

SettingsSettingsSettings
Swift Basic Programming Test - Quiz

Developed by Apple Inc. For iOS, macOS, Linux, watchOS, and tvOS, Swift is a multi-paradigm programming language. Take this basic programming test to assess your knowledge of Swift.


Questions and Answers
  • 1. 
    Which keyword do you use to announce constants in Swift? 
    • A. 

      Var

    • B. 

      Let

    • C. 

      Con

    • D. 

      Value

  • 2. 
    How many types of integers are in Swift? 
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 3. 
    Swift integers are presented in all of these bit forms except which of the following?
    • A. 

      24

    • B. 

      16

    • C. 

      32

    • D. 

      64

  • 4. 
    What type of integer is denoted by “Int8”? 
    • A. 

      Open

    • B. 

      Signed

    • C. 

      Unsigned 

    • D. 

      Close

  • 5. 
    What are numbers with fractional components called in Swift? 
    • A. 

      Sinking numbers

    • B. 

      Decimals

    • C. 

      Floating numbers

    • D. 

      Fractional numbers

  • 6. 
    How do you write comments in Swift? 
    • A. 

      */ and */

    • B. 

      /* and /*

    • C. 

      /* and */

    • D. 

      */ and /*

  • 7. 
    What are the collection types in Swift? 
    • A. 

      Dictionary and array

    • B. 

      Array and library 

    • C. 

      Dictionary and library

    • D. 

      Library, dictionary and array

  • 8. 
    Which of these is not a control transfer statement in Swift? 
    • A. 

      Break

    • B. 

      Continue

    • C. 

      Change

    • D. 

      Return

  • 9. 
    What does the question mark (?) indicate? A particular property is... 
    • A. 

      Necessary

    • B. 

      Missing

    • C. 

      Optional

    • D. 

      Changed

  • 10. 
    What should you use to provide a default value for a variable in Swift?
    • A. 

      ?

    • B. 

      ??

    • C. 

      &

    • D. 

      &&

Back to Top Back to top