# Swift Program to Add Two Numbers

## Swift Program – Add Two Numbers

To add two numbers in Swift, we can use Arithmetic Addition Operator.

Arithmetic Addition Operator `+` takes two operands and returns the sum of the two numbers. So, give the two numbers we would like to add as operands to the Addition Operator.

``number_1 + number_2``

## Swift Example

In this example, we will take two numbers in two variables: `number_1`, `number_2`, and find their sum.

main.swift

``````import Foundation

var number_1 = 25
var number_2 = 88

var result = number_1 + number_2

print("\(number_1) + \(number_2) = \(result)")``````

Program Output

``25 + 88 = 113``

The type of numbers can be int, float, double. But, both the numbers should be of same type.

Now, let us take float values in the variables, `number_1` and `number_2`, and find their sum.

main.swift

``````import Foundation

var number_1:Float = 3.01
var number_2:Float = 4.01

var result = number_1 + number_2

print("\(number_1) + \(number_2) = \(result)")``````

Program Output

``3.01 + 4.01 = 7.0200005``

## Summary

We have learnt how to add two numbers in Swift.