The For Loop | Development | Online Course With Appy Pie Academy

The For Loop

Lesson Details:
July 10, 2020


I: Introduction:

What is a programming language? A computer programing language is a set of rules and instructions that tell the machine how to run a program. The two main purposes of programming languages are:

- To provide a way to communicate to the computer what you want the computer to do.

- To provide a method for writing programs so that they can be understood by other programmers.

The great thing about programming languages is that it makes it easy to create logical and consistent programs that can solve problems and perform tasks. These programs consist of small instruction sets that can be put together to make bigger programs or functions. The programs and functions can then be combined and made into bigger and better programs and functions. The process continues until we have a software solution to our problem. Programming also allows us to build applications that solve real world problems such as spreadsheets, word processors, games, and many more. This can be done by using commands such as if, else, for loops, variables, arrays, and methods.

These commands make building complex solutions much easier because we can now reuse code instead of having to rebuild it from scratch each time we want to use it.

II: Body:

First I will explain the for loop. The for loop is a command that allows us to repeat a block of code a certain number of times. It does this by counting the number of times the block will execute and storing it in a variable called i. The for loop also allows us to specify the starting number and ending number of times the loop will execute. The command used is as follows:

for(int i = 1; i < 3 xss=removed>), and logical operations (&&, ||). The expression's operands are evaluated (that is, substituted into the expression according to their type's rules) from left-to-right; if all operands are integers, integer arithmetic is performed; otherwise, floating-point arithmetic is performed. The result becomes the value of the expression; if there are two operands and one has integral type and the other has floating-point type, then integral arithmetic is performed before floating-point arithmetic. For example: "5 * 2" computes 5 * 2 = 10 whereas "5 + 2" computes 5 + 2 = 7 because when integer arithmetic is performed before floating-point arithmetic, it's done from left-to-right and in numeric order: −6 / −3 * 4 = −6 / −12 * 4 = −6 / 24 * 4 = −6 / 96 * 4 = −6 / 384 * 4 = −6 / 768 * 4 = −6 / 3072 * 4 = −3072 */768 * 4 = −3072/768 * 4 = −31 */768 * 4 = −31/768 * 4 = −32 */768 * 4 = −32/768 * 4 = −33 */768 * 4 = −33/768 * 4 = −34 */768 * 4 = −34/768 * 4 = −35 */768 * 4 = −35/768 * 4 = −36 */768 * 4 = −36/768 * 4 = −37 */768 * 4 = −37/768 * 4 = −38 */768 * 4 = −38/768 * 4 = −39 */768 * 4 = −39/768 * 4 = −40 */768 * 4 = −40/768 * 4 = −41 */768 * 4 = −41/768 * 4 = −42 */768 * 4 = −42/768 * 4 = −43 */768 * 4 = −43/768 * 4 = −44 */768 * 4 = −44/768 * 4 = −45 */768 * 4 = −45/768 * 4 = −46 */768 * 4 = −46/768 * 4 = −47 */768 * 4 = −47/768 * 4 = −48 */768 * 4 = −48/768 * 4 = −49 */768 * 4 =−49/768*4=−50*/ 768*4=−50/768*4=−51*/ 768*4=−51/768*4=−52*/ 768*4=−52/768*4=−53*/ 768*4=−53/768*4=−54*/ 768*4=−54/768*4=−55*/ 768*4=−55/768*4=−56*/ 768*4=−56/768*4=−57*/ 768*4=−57/768*4=−58*/ 768*4=−58/768*4=−59*/ 768*4=−59/768*4=−60*/ 768*4=−60/768*4=−61*/ 768*4=−61/768*4=−62*/ 768*4=−62/768*4=−63*/ 768*4=−63/768*4=−64*/ 768*4=−64/768*4=−65*/ 768*4=−65/768*4=−66*/ 768*4=−66/768*4=−67*/ 768*4=−67/768*4=−68*/ 768*4=−68/768*4=−69*/ 768*4=−69/768*4=−

loader
Course content