Engineering Science 1036A/B Lecture Notes - Lecture 4: Special Library, Switch Statement, Semicolon

58 views14 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents