Tag Archives: #if

Mastery16


Mastery16

Mastery16

Use of “else” with a conditional
The nested if…else statement has more than one test expression. If the first test expression is true, it executes the code inside the braces{ } just below it. But if the first test expression is false, it checks the second test expression. If the second test expression is true, if executes the code inside the braces{ } just below it. This process continues. If all the test expression are false, code/s inside else is executed and the control of program jumps below the nested if…else

Conditional/Ternary Operator ?:
Conditional operators are the peculiar case of if…else statement in C++ Programming.
link: http://www.programiz.com/cpp-programming/if-else#if-else

#TC1017 #Mastery07

https://github.com/Carlos18/TC1017/blob/master/comentarios.cpp

A comment is text that the compiler ignores but that is useful for programmers. Comments are normally used to annotate code for future reference. The compiler treats them as white space. You can use comments in testing to make certain lines of code inactive; however, / preprocessor directives work better for this because you can surround code that contains comments but you cannot nest comments.

A C++ comment is written in one of the following ways:

  • The /* (slash, asterisk) characters, followed by any sequence of characters (including new lines), followed by the */ characters. This syntax is the same as ANSI C.

  • The // (two slashes) characters, followed by any sequence of characters. A new line not immediately preceded by a backslash terminates this form of comment. Therefore, it is commonly called a “single-line comment.”

The comment characters (/**/, and //) have no special meaning within a character constant, string literal, or comment. Comments using the first syntax, therefore, cannot be nested.

Reference.

https://msdn.microsoft.com/en-us/library/k1dbk8bw.aspx

 

Mastery 15

Mastery15

For this mastery we demonstrate to have the ability to use “if” conditional.

In this c++ code I used “if” conditional, but I mixed it with “else if” and “else”, but I am going to explain them in other post.

In the following links I found useful information about “if” conditional:

http://www.tutorialspoint.com/cplusplus/cpp_if_else_statement.htm

http://www.omijal.org/pagina_c/conds.html

Also, I did a pp to explain “if” conditional and I hope that you learn something about the conditional.

https://drive.google.com/file/d/0B-NM4ghaDXBvY0xzVW0taWpaZ1U/view?usp=sharing