Loops Day 3 / Strings / Range-Based For Loops

Channel:
Subscribers:
2,650
Published on ● Video Link: https://www.youtube.com/watch?v=8MOJnH7kH_0



Duration: 1:00:42
120 views
2


We started with an exercise to find the factors of a number, and then use this to tell if a number is prime. (There are ways of finding out if a number is prime without factoring it, but you'll learn that in CSCI 26.)

We then moved into a discussion of strings, and how to 1) get the size of a string, and 2) how to get individual characters from a string.

We introduced our third loop, the ranged-for loop (aka the range-based for aka the foreach loop) which allows you to do things like say "For every character c in a string, output the uppercase version of c".