Tutorials

Tutorials

C++ While Loop

C++ while loop is the simplest loop. It executed its statements repeatedly until the given condition remains true.  As the condition becomes false the while loop will be terminated and control goes to the statements just after the while loop. Syntax: while loop in C++ Working: while loop in C++ In a while loop, first … Read more

Tutorials

C++ For Loop

C++ for loop is used to repeat statements or a piece of code a specified number of times.  It works same as the working of the while loop but it is more flexible than that. That’s why it is the most frequently used loop than the other loops such as while or do-while loops. Syntax: … Read more

Tutorials

C++ Switch Statement

The C++ switch statement is a conditional statement like if-else. It is used to execute a specific choice from all available choices. The switch statement compares the result of a single expression with all available cases. If the result matches with any case, the relevant block of statements is executed. Syntax: Switch statement in C++ … Read more

if statement in cpp
Digital Trends, Tutorials

C++ If-else Statements

C++ If-else statements in c++ are the conditional statements. They are used to decide which part or code block of the program will be executed according to the pre-defined conditions true or false.  Relational operators are used to specify the conditions in c++. There are many ways to use if-else statements in C++ like if, … Read more

cpp-manipulators
Tutorials

C++ Manipulators

In this tutorial, you will learn about C++ Manipulators. They are used to styling output in various ways. This is the most common way to control the program output. There are many manipulators used in the c++ language like, endl, setw, Setprecision, Setfill, Showpoint, and fixed. Here we discuss them one by one. endl manipulator … Read more

cpp-inout-and-output
Tutorials

C++ Input / Output

C++ Input / Output are the two main features of the C++ programming language.  A standard input stream (cin) object is used to take input from the user.  The standard output stream (cout) object is used to print the output on the computer screen. The standard input/output stream (iostream) header file provides the definitions of … Read more

Tutorials

C++ Comments

C++ Comments are the non-executable line of code.  It is used by the programmer to make the code more readable for himself or for other programmers. It is written for the convenience of the programmer to make the code easier to understand. There are two types of comments Single Line Comment Multi-Line Comment Single Line … Read more

Tutorials

C++ Expressions

C++ Expressions are the combination of one or more operands and operators that are involved in the computation. Every expression produces a result that can be stored in a variable. Below are a few examples of expression There are many types of c++ expressions depending on the type of operator used. Constant Expressions Integral Expressions … Read more

Tutorials

C++ Operators

You declare a variable after that operators are used to perform logical or mathematical operations on that variable’s values. For example, int age = 27; where the “=” symbol is an assignment operator that assigns 27 to the age variable. C++ programming language support many operators that are divided into different groups. Arithmetic operators Assignment … Read more

Tutorials

C++ Constants

C++ constants are fixed values that can not be altered at any stage of the program. Const literal is used to make any variable a constant or read-only. Syntax For Example Note We can use constants (const) for the fixed value variables whose value remains the same throughout the program. Recommended Article C++ program to … Read more

Scroll to Top