It can be confusing to know the difference between if and if-else in the beginning. Take note that these are used in the C language. The “if” statement is used if the condition is true. This means that if the condition is false, it will not do anything. The “if-else” statement, on the other hand, checks the statement first and will ask if the condition is true. Once proven true, it will execute a series of commands.
If the condition is false, it will execute a series of commands that are also different. For example, if you would like to prove if a number is odd. If you would use an “if” statement, it will not do anything if the number is even. If you are going to use the if-else statement, the tasks that will be done are also going to be different.