Month: April 2022

Constants in C++ Language

Constants in C++ Language: (1) In C++ Language, Constants means read-only variables. (2) Syntax of CONSTANT variable: const double myDouble = 10.5; (3) Example as shown: (4) As per the above image, the system shows an error while “Build” the written code for execution because in Constant variable case, you cannot assign another value. Continue Statement …

Identifiers in C++ Language

Identifiers in C++ Language: (1) In C++ Language, Identifiers are nothing but variables. It is recommended to define variable names as unique and more descriptive. Like int myInt → myInt is Identifier double myDouble → myDouble is Identifier char myChar → myChar is Identifier. stringmyString → myString is Identifier bool myBool → myBool is identifier (2) …

Use of endl in C++ Language

Use of endl in C++ Language: (1) “<< endl” is an alternate of “\n” for inserting a new line or print output in the next line.  (2) Sample C++ language code and its output, as shown: #include <iostream>using namespace std;int main() {cout<< “My first C++ Language Line!” <<endl;cout<< “My second C++ Language Line!”;return 0;} (3) After …