##### 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:

`if <condition> == <value> { <code> }`

For example:

`if 5 + 5 == 10 { fmt.Println(“Maths”) }`

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

For example:

`if 5 == 5 { x := 5 } else if 5 == 4 { x := 4 } else { fmt.Println(“idk”) }`

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.

OPERATORS

&& - 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

HOMEWORK

Make a trivia game comment a link to yours down below!

Anyway Upvote for part 4!

Part 4: https://repl.it/talk/learn/Golang-Googles-C-Part-4-Functions/42944

Part 5: https://repl.it/talk/learn/Golang-Googles-C-Part-5-For-Loops/43033

thanks for the shoutout! Yours will be in the next series.

ooh smart no days so that you can post every 2 hours and @hahayes has to post at most once a day