In a source code, each line is referred to as a line number. We can write our code and also print the line number of each line of code.
print(#line)
#line
: This represents each line number in the source code.
It returns the line number of each source code.
import Swift// create some variablesvar num1 = 34;var num2 = 50;print("This is line: ", #line)print("The sum of ", num1, " and ", num2, "is and line number is ", #line)