You are on page 1of 2

Lecture 7: (mult table)

Do/while statements:

When ‘while’ is false, it doesn’t execute. Do-while ensures that the program is run at least once.

Do {} while (condition)

No diff apart from syntax in while and for loop

Lecture 8: (income tax)

Switch statements: diff conditions for programs. User decides which statement to execute

Switch>choice>case

Without a “break;” statement, all statements will be executed

“continue;” used to pause program

Structure: everything between the parent {}

Lecture 9 – functions

Functions contain data. Can be called for use whenever needed.

Two categories: func that retain value; don’t retail value

Lecture 11 – Arrays

Arrays are the collection of variables that can store data of the same type.

Max limit can be defined

One int=4 bytes

To copy arrays, both must be of the same type and size

Left side: store

Right side: pass

Lecture 12 – Char arrays

Name address etc

How to declare: char arrayname [cap] = {‘a’, ‘v’}

Replacing old with new value: swapping

You might also like