Golang Googles C++ Part 3: Logic Operations!
First lemme say that we are falling down in the ranks so I need your support more now than ever.
Secondly, go check out @HahaYes and his C++ tutorial.
Okay now we can get to work!
So let’s say you had a variable and you wanted to test what its value was.
Well, you can’t.
Unless you have logic operations!
Logic is a fundamental of computer science and for good reason too!
Without logic a computer is just a remembering machine. Not very useful.
But you can introduce logic very easily.
In Go logic is easy:
See it’s very simple!
Now we need to also talk about else if and else statements!
Else if - executes if the prior if and or else if statements weren’t true but this one is.
Else - executes if the prior if and else if statements weren’t true
Yep that’s it!
Now what are operators?
Well in math operators are like +, -, *, /, and =
What is one thing they all have in common?
They take two values and perform operations with them.
These two values otherwise known as operands can include operators too!
Well in Go these can apply to if statements too!
So here they are.
&& - executes the code only if both conditions on either side are true.
|| - executes the code only if one or more of the conditions on either side are true.
== - equals sign
! - does not equal sign
Make a trivia game comment a link to yours down below!
Anyway Upvote for part 4!