Category: C++ Language

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 …

How to Insert a New Line in C++

Insert a New Line in C++: (1) “\n” is used 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!\n”;  cout << “My second C++ Language Line!\n”;  return 0;} (3) After …

cout in C++ Language

cout in C++ Language: (1) “cout<<” is used for printing output value or text.  (2) Sample C++ language code and its output, as shown: #include <iostream>using namespace std;int main() {cout << “My first C++ Language code!”;return 0;} (3) After that go to the “Build” menu and select the “Build” option for publishing the code as shown. …

C++ Language Syntax

C++ Language Syntax: (1) C++ Language is designed by “Bjarne Stroustrup”. (2) C++ Language is an object-oriented programming language. (3) C++ Language gives a high level of control over system resources and memory. (4) C++ Language is used in Operating systems, embedded systems etc. (5) For learning C++ Language, first install the editor and compiler. For …