 What's up, everybody? Welcome back to C++ Programming. I'm your host, Root of the Nell, and in the last video, we looked at the if statement. We were looking at conditionals in our C++ code. Now, let's expand on this. I'm going to go ahead and save a copy of my code. I'll call mine 10 if statement, actually, just 10 underscore comparison operators.cpp. Cool. Let's change this up a bit. I used this kind of example in my... Yeah, I will actually keep that line there. Hello, world. I used this example in my Python series. I actually tested... I said, how many virgins did you find? And then you would enter an integer, which was the number of virgins. So if we input that with C in, remember, we know how to do that. We have this variable. We have another variable, what Bin Laden said. And he said 72. Bin Laden said there would be 72 virgins. And we're going to test if number of virgins is equal to what Bin Laden said. So if we do have it, Bin Laden was right. If we found 72 of them, and Bin Laden was right. Cool. Let's run this code. Let's see how it works. G++ 10. And let's run it. Hello, world. How many virgins did you find? Well, I'm not dead yet, so I did not find any. Well, damn. Nothing happened. Bin Laden was neither right nor wrong. This condition did not run because the number of virgins is not equal to what Bin Laden said. Let's try this one more time. If we run this code and we have 72, Bin Laden was right. He found 72 virgins, and that's what we found, too. There were 72 virgins. Now let's actually get into the comparison operators other than the is equal to. What if we had is less than or equal to. Now you'll note that the other equal sign has turned into the less than symbol. Now, if I said number of virgins is less than what Bin Laden said, that means that Bin Laden overshot it a little bit. And you'll see this in action. Fire on the code. Hello, world. How many virgins did you find? Well, I found 30. Bin Laden overshot it a little bit. He said there would be 72. I mean, well, there was only 30. But remember, we used the less than or equal to operator. We could very well have said 72, and it's still going to tell us that he overshot it a bit. What if we did this and we had too many? What if we had 100 virgins? Nothing happens, because the condition is no longer true. 100 is greater than 72. It's not less than or equal to, so this won't happen at all. What if we did greater than or equal to, though? We've got that option, right? How many virgins did you find? Well, found 100. Bin Laden overshot a little bit, even though, in this case, Bin Laden underestimated it. 100 is much larger than 72. He underestimated it. We can, of course, just use simple, greater than or less than operators. We don't have to have this equal sign at the very end of them. I won't show you that functionality, but I'm sure you can understand how it would work. We do have another one that is the not comparison operator that says if the number of virgins is not what Bin Laden said, and this is an exclamation point and an equal sign. So if it's not, then Bin Laden was wrong. Very, very simple. If I run this code, how many virgins did you find? I found 20. Bin Laden was wrong. If I found 72, which is what Bin Laden said, nothing will happen, because number of virgins is equal to what Bin Laden said. It is not not what Bin Laden said. So those are the comparison operators. We've got less than, greater than, less than or equal to, greater than or equal to, and not equal to. Good stuff. Good, good stuff, right? Okay. That's all I really wanted to show off in this tutorial. Just those operators and how you can understand them and what they do. They're very simple, of course, and that's what we're looking at right now. Just the fundamentals, the basics. Thanks for sticking with me, though, guys, and I'll see you in the next tutorial.