Aqui esta un nuevo tutorial para poder saber como utilizar un if y tambien un else como condicionales.
Aqui esta el link: https://youtu.be/dvsp4tkc1Ko
#Tc1017
#Mastery15
#Mastery16
Continue reading ]]>Aqui esta un nuevo tutorial para poder saber como utilizar un if y tambien un else como condicionales.
Aqui esta el link: https:/
#Tc1017
#Mastery15
#Mastery16
]]>Use of “else” with a conditional
Continue reading ]]>
Use of “else” with a conditional
]]>
This is the second time I do this Mastery16 in order to make two points out of it!
I will explain you how to use an else conditional..
But first, why use an else conditional and how does it work. Well the else conditonal is use with the if conditional which i already explained earlier. The else conditional is when the if conditional is false, lets say, if you ask the user something with if and is true it wil return you whatever you put there, but if it isn´t true then it will not print anyting unless you have another if or somekind of cout outside the if, but is more bother to do that.
What the else conditonal does is to return you something if the if conditional isn´t true.
The syntax for using else is:
"else
{
}"
As you can se is pretty easy to do so sure it will be no problem using it.
But let see how will you use with an if when the variable num is somehting the user give us and we ask for a number between 1 and 10:
"if (num 10)
{
cout
} else {
cout
}"
What does it say with words "If you put a number less than 1 or higher than 10 then it prints "Your number is invalid", or if your numbers is higher or equal to 1 and less or equal to 10 then it prints "Great your number is between 1 and 10".
So here you can se how easy is to use the else conditional and that it is very very useful when your are doing enourmous codes and your tired of writing or just because is not compplicated.
Hope you learn from this!
Continue reading ]]>This is the second time I do this Mastery16 in order to make two points out of it!
I will explain you how to use an else conditional..
But first, why use an else conditional and how does it work. Well the else conditonal is use with the if conditional which i already explained earlier. The else conditional is when the if conditional is false, lets say, if you ask the user something with if and is true it wil return you whatever you put there, but if it isn´t true then it will not print anyting unless you have another if or somekind of cout outside the if, but is more bother to do that.
What the else conditonal does is to return you something if the if conditional isn´t true.
The syntax for using else is:
“else
{
}”
As you can se is pretty easy to do so sure it will be no problem using it.
But let see how will you use with an if when the variable num is somehting the user give us and we ask for a number between 1 and 10:
“if (num 10)
{
cout
} else {
cout
}”
What does it say with words “If you put a number less than 1 or higher than 10 then it prints “Your number is invalid”, or if your numbers is higher or equal to 1 and less or equal to 10 then it prints “Great your number is between 1 and 10”.
So here you can se how easy is to use the else conditional and that it is very very useful when your are doing enourmous codes and your tired of writing or just because is not compplicated.
Hope you learn from this!
]]>Just did the mastery 16, quite easy to understand, you just need a little bit of logic.
Continue reading ]]>Just did the mastery 16, quite easy to understand, you just need a little bit of logic.
]]> En esta sentencia no se plantea directamente una condición, es mas bien, una respuesta a la condición que se formulo dentro de la sentencia "if". Si la condición de "if" no se cumplió, entonces se ejecuta el bloque de código que contenga la sentencia "else".
Además, no puedo haber una sentencia "else" sin su respectiva sentencia "if"
la sentencia else funciona despues de ingresar una función if. despues de que el valor de if de erroneo, corre directamente la función else con el codigo que se este utilizando.
Continue reading ]]> En esta sentencia no se plantea directamente una condición, es mas bien, una respuesta a la condición que se formulo dentro de la sentencia “if”. Si la condición de “if” no se cumplió, entonces se ejecuta el bloque de código que contenga la sentencia “else”.
Además, no puedo haber una sentencia “else” sin su respectiva sentencia “if”
la sentencia else funciona despues de ingresar una función if. despues de que el valor de if de erroneo, corre directamente la función else con el codigo que se este utilizando.
]]>