You Are Browsing ‘Tutorials’ Category

Compilation, Linking & Execution of a C++ program: Tutorial for beginners

In the previous post, we had learned to write a basic  C++ program. We should now understand how a program works and how the computer handles it. Let us see the different phases a C++ program goes through before execution. PHASE 1: PREPROCESSING Preprocessor directive #include is used to include header files in our program. These header files contain declarations (name and type) of certain predefined elements...

Use of endl and setw manipulators in C++

In the previous post, we had shown how basic input/output is performed in C++. Along with input/output operators, C++ provides a facility to control how the output is displayed on the screen. This is done using manipulators. Let us understand what manipulators are.  Manipulators are functions that are used to format or modify the output stream in various ways. They have a special characteristic that they are...

How to Perform Basic Input/Output Operations in C++

Input and Output operations are an important part of any program. Input operations take data from the user and output operations display the result of the program to the user. Let us understand the basic input/output operations in C++ program with the help of a simple program. The following program takes two numbers as input from the user, multiplies them and displays the result to the user. //Program to multiply...