Viewing 1 to 7 of 70 items
Archive | Programming RSS feed for this section

C++ – Scope of Variables

The scope of a variable determines the block of instructions in which a variable may be accessed. To understand this topic, we’ll start by discussing local variables. Local Variables Local variables may be accessed within the block of instructions in which they were declared. For example, when we write a main function, all variables declared  Full Article…

1

C++ Functions

A function gives the user the ability to execute a block of instructions on a set of inputs to receive a particular output. Functions are useful when the user needs to execute a set of instructions many times with different parameters. The syntax for a function is below: return_type name(parameter1, parameter2, …) { statements }  Full Article…

0

C++ Do While Loop

The Do While Loop is different from the While Loop for one reason only. The condition is checked after executing the statements. Therefore, this loop guarantees that the statements will be executed at least once. The syntax for the Do While Loop is below: do {   // Statements …   } while ( condition  Full Article…

3

C++ For Loop

In our previous tutorial, we learned about C++ While Loops. Today, we’ll learn about for loops. For loops are different than while loops due to the way they function. This allows one to choose what type of loop to use depending on the problem. For example, while loops are useful for executing statements until a  Full Article…

0

C++ While Loop

In our previous tutorial, we learned about C++ If Statements which introduced us to the idea of control flow and conditions. Today, we introduce the while loop. The While Loop The while loop is another control flow structure that allows the programmer continuously execute a block of instructions until a specific condition is met. Below  Full Article…

2

C++ If Else Statements

In our previous tutorial, we learned about C++ input and output to make our programs more interactive. Well, today we are going to learn how to use If Then Else statements to allow us to control the flow of the program. This will allow us to execute code based on a given condition. Below is  Full Article…

0

C++ Input and Output ( cin, cout )

In our previous tutorial, we learned about the C++ String datatype. Until know, our C++ programs haven’t been that interactive. In this tutorial we are going to fix that. We are going to talk a little more in depth about gathering input from the user and displaying the output to the terminal. C++ Standard Output  Full Article…

2