In this post, I will explain about how to write a swift program to add two numbers with an example and real-time output. This program will helps you to more understand the swift programming language.
This is a very basic program in Swift programming language. If you are Swift beginners or want to start learning Swift programming language, then this program will help you to understand the basic Swift programming.
Before executing this program I assume you have configured swift on your computer. Copy the below program and create a file “Addition.swift” and execute it.
var x = 15
var y = 5
var z = 0;
z = x + y;
Tags: how to add two integers in swift, how to add two number in swift, swift add two numbers, swift operators, swift program, swift program example, swift program for addition, swift program to add two numbers