C++ Keywords and Identifiers

C++ Keywords

C++ keywords are the reserved words which are pre-defined in C++ programming language. We cannot use keywords as an identifier. Each keyword has a pre-defined meaning for C++ compiler.

C++ Basic Input and Output

In this tutorial we learn about basic input and output capabilities provided by C++ programming language. For Input and output, C++ programming language uses an abstraction called streams which are sequences of bytes. A stream is an abstract entity where a program can either write or read characters. It hides the hardware implementation and details from the C++ program.

C++ Comments

Comments are added in C++ program for documentation purpose. Comments are explanatory statements that we can in our code to make it easy to understand for anyone reading this source code. We can add comments anywhere and any number of times in our programs. Adding comments in your code is highly recommended and is considered as a good programming practice. Comment are ignored by C++ compilers.

C++ First Program Hello World

In this tutorial, we are going to learn about the basic structure of a C++ program. Let's first write a simple C++ program to print "Hello World" string on screen. This program is very useful to learn the basic syntax and semantics of the C++ language. It become the traditional first program that many people write while learning a new programming language.

Program to Print all Pair of Numbers Whose Difference is K

  • Write a program to find a pair of number whose difference is equal to K
  • Algorithm to find a pair of array element whose difference is equal to given number.

Program to Find Next Greater Element for Every Array Element

  • Write a program to find next larger element of array
  • Algorithm to find next greater element using stack data structure and in O(n) time complexity.