jweinst1
2/20/2016 - 11:30 PM

struct that sums numbers to a point in swift

struct that sums numbers to a point in swift


struct summer {
    static func sumtonum(end:Int) ->Int {
        var total = 0
        for num in 1...end {
            total += num
        }
        return total
    }
}