Chapter 19 : Incrementing and Decrementing Operators
//
// main.swift
// Swift Tutorials 2014-15
// Incrementing and Decrementing Operators in Swift
//
// Created by Code2care on 16/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
var i = 10
//Increments a by 1, then returns i
println(++i)
//
// main.swift
// Swift Tutorials 2014-15
// Incrementing and Decrementing Operators in Swift
//
// Created by Code2care on 16/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
var i = 10
//Returns i, then increments i by one
println(i++) // no increment
println(i++) // increment by 1
//
// main.swift
// Swift Tutorials 2014-15
// Incrementing and Decrementing Operators in Swift
//
// Created by Code2care on 16/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
var i = 10
//Decrements i by 1, then returns i
println(--i)
//
// main.swift
// Swift Tutorials 2014-15
// Incrementing and Decrementing Operators in Swift
//
// Created by Code2care on 16/09/14.
// Copyright (c) 2014 Code2care. All rights reserved.
//
//Returns i, then decrements i by one
println(i--)
println(i)