Pure Programmer
Blue Matrix


Cluster Map

Sequence

L1

This page is under construction. Please come back later.

In programming languages we have three ways to control the flow of statements: Sequence, Selection and Iteration. Sequence is the simplest and most basic flow control mechanism. It simply means that statements are executed sequentially in the order they appear in the program.

Sequence1.swift
#!/usr/bin/env swift;
import Foundation

// Begin Main
var x:Int = 1
print("x: " + String(x))
x = 2
print("x: " + String(x))
x = 3
print("x: " + String(x))

exit(EXIT_SUCCESS)

Output
$ swiftc Sequence1.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)
swift

Questions

Projects

More ★'s indicate higher difficulty level.

References