MATH 1P12 Lecture Notes - Lecture 2: Boolean Expression, Cosc, Operand

63 views3 pages

Document Summary

Cosc 1p02 tutorial exercise 5 (feb 25th, 2020) In this lab we will look at boolean expressions. We have encountered boolean expressions (or conditions) in a variety of contexts: while statement: while ( condition ) { statementlist. If statement and if-else statement: if ( condition ) { statementlist if ( condition ) { statementlist1. } else { statementlist2 for statement for ( int i = 0 ; condition ; i++) { statementlist. Boolean expressions are expressions that result in a truth (as opposed to, say, a numeric) value: true or false. Since a boolean expression computes a value, it is also possible to have a variable which stores such a value such a variable is called a boolean variable. We have seen one kind of boolean expression the so-called relational expression where numeric values can be compared (related) using the relational operators:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related textbook solutions

Related Documents