Engineering Science 1036A/B Lecture Notes - Lecture 4: Special Library, Switch Statement, Semicolon
Document Summary
An if-expression is always evaluated as either true (1) or false (0) The if-statement"s statement will only be executed if the statement is evaluated as true. In general, the expression in the if statement can use two types of operators. Comparison (>, =, ==, !=) Since the if-statement itself is a statement it can also appear in the body of another if- statement. General form (example): if (expression 1) if (expression. 2) statement; is also equivalent to if (expression 1 && expression 2) statement; toupper() and tolower(): These are pre-defined functions is used for the data type char" and needs no special library. Toupper(c) (where char c; ) this function will convert the argument c to an uppercase character if it is a lowercase letter. If the argument is already an uppercase letter, then the function will return the same letter. Tolower(c) (where char c; ) this function will do the opposite of the toupper() function.