Hello, welcome to the 17th tutorial and the swift programming series. And in this part we'll learn look at function parameters in the previous part, we looked at functions. Function basically allows you to group code or you can call it several times function parameter, the latest send values to those functions when it is called, for example, a simple math function may add two numbers together, obviously, it can do more complex stuff in your program, and you most likely will, but we're just going to implement a simple math function that like was said, in that just add the numbers together. So what we're going to do is first is declare a function, we're going to call print math function. And then to declare the parameters, you put it within the brackets. So you put the parameter name or the local parameter.
Now I should take it outside the function, you can't be accessed and then you put a colon and it's data type. Gonna put in number comma first my lead number to hold on. And so bracker break point, what we're gonna do is just cram from line number one, time. Number two, they're spending number one, and number 2am printed out when this function is called the mean Yeah, print math function, they specify the numbers, they can also be variable, the orange area, or perhaps it could be something like a float and you cast it to an int, which we talked about typecasting earlier on in the series. So convert five and seven, so those should be 35. Now we're gonna only have a result of 35.
But if I just get rid of these, it no longer works because obviously, these are function call this but what you can do with an extra finger show you land on the basic function. Now if I run this, you'll run the regular ones in one without parameters. So the compiler is smart enough to know that Oh, you're calling a function, we have no parameters to function with that name, but you call it your window parameter. So we'll just call this He called this slide, obviously, but if you put a parameter in there, though, six, and eight, so you should get the result of 48 equals this one. So that's it for this tutorial. The next tutorial we're gonna look at the function return statement.
If you have any questions, feel free to message us at support our solar system. Correct. Okay, the email will be in the description. You can comment on this video or just directly message us by YouTube. All the requirements for the source code will also be in the description. And as usual, thanks for watching and have a nice day.