 Hi everyone, in this tutorial, we're going to talk about that and if else, statement in Rust programming language can return a value, but first of all, make sure to subscribe to my channel because more subscribers means more quality videos on my channel. Now let's back again to the main topic. One thing about if else statement in Rust programming language is that it's an expression, so that means it returns a value. So if else is an expression and it can return a value. Let's make a simple program to demonstrate that. First we're going to make main function and let's use a number. Let's say that our number is for example 28 and let's try to use if else statement to see if our number is even or odd and if our number is even or odd, we are going to try to divide it by number 2 and print this result to the screen. Now we're going to make a variable number. Our variable number is going to keep the returning value of our if else statements. First, let's use if to ask if our value n is even and if it's even then we want to print even to the screen and we want to return this value divided by 2. So if statement can return a value, returning value always is going to be on the last line of this statement and we're going to avoid usage of semicolon sign. If you use semicolon sign that this value is not going to be returned. So we want to avoid this semicolon sign. So now this result of this division is going to be a value of our variable number or if this number is not even it means that it is odd and we're going to print word odd to the screen and we want to add number 1 to this number and to divide it by 2. Again, we're not using semicolon sign because we want to have a returning value. So we must avoid it. So those two values are going to be returning values and one of them is going to be assigned to a variable number and let's print the result of our variable number. So we want to use print line macro and to print number. Then again, if we're using this kind of if else statement to get a value, we must close it with a semicolon sign. Okay, let's try to run our code. And as you can see, we will get number 14 as a result and printed text even because our number is 28. This number is even and the returning value of our number is going to be that number divided by number 2. Let's try to use, for example, number 29, then our number is going to be odd. We're going to print odd text to the screen and then we're going to add 1 to 29. So here we're going to have number 30 and we're going to divide it by 2 and we will get result 15. That's all in this tutorial. I hope so that you understand the concept of that you can get a value from if else statement in Rust programming language. That's all in this tutorial. Thanks for watching and again, don't forget to subscribe to my channel.