// While20.swift Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2014-09-26 File created. // 2015-10-17 Last modification. // This program demonstrates how to write a simple while loop. var number_to_print = 0 print( "\n Numbers from 0 to 20 are the following:\n") while number_to_print <= 20 { print( " " + String( number_to_print ), terminator: "" ) number_to_print += 1 } print( "\n\n" )