CS 1100 Lecture Notes - Lecture 15: Boolean Expression

19 views2 pages
19 Oct 2016
School
Course
Professor

Document Summary

Typically a loop will run until its boolean expression is false. Sometimes we may want to end the loop prematurely or manipulate the repetitions in some other way. Not only can be used in switch statements, but also in a loop. When used in a loop, the loop instantly ends, instead of finishing the boolean expression. Instead of ending the entire loop like break, continue end that particular iteration, then the loop continues on to the next iteration. One can make a program that gets a string from the user, and it discerns if it is a palindrome or not. Checking if the characters on each end of the string match. An integer that is greater than 1 and only divisible by 1 and itself. Primes: 2, 3, 5, 7, 11, 17, 19. One can write a program to find if a number given by user is a prime or not.

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