You Are Browsing ‘CBSE Class 12’ Category

Built-In Data Types in C++: char, int, float, double

Data types in C++ are keywords that are used to specify the type of the data we use in our C++ programs. There are many data-types available in C++. They are classified under two categories: Built-In or Fundamental Data types Derived or User-Defined Data types Built-in data types Built-in data types are the most basic data-types in C++. The term built-in means that they are pre-defined in C++ and can be used...

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...

Structure & Components of a basic C++ program – Tutorial for CBSE Class 11 & 12

Having learned about tokens in C++, we are now ready to write our first C++ program. The aim is to learn the basic structure and components of a C++ program. So what follows next is our program. It has been written and executed using the Dev C++ Compiler. //I am going to write my first C++ program /* The aim is to learn : 1) Structure of a program 2) Basic Components of a program */ #include<iostream> #include<conio.h> using...

5 Types of Tokens in C++ : CBSE Class 11 & 12 Basics

In our previous post, we had talked about the character set used in C++. We will next discuss tokens in C++ and their various types. Let us now find out what a token is. DEFINITION: A token is the smallest identifiable and individual unit in any program. It is formed when a group of characters is combined together. There are five types of tokens in C++ language: Keywords Variables/Identifiers Constants/Literals Punctuators Operators 1....

What is C++ Character Set? – Basics for CBSE Class 11 & 12

Let us begin our C++ journey by learning what a character set is. The set of all characters that can be used in a C++ program constitutes the C++ Character Set. Just as in the English language we have alphabets which are then used to form words, sentences and paragraphs, in C++ too, there is a set of valid characters which are used to form words and then statements and so on. Now let us see the different components...

Basics of FOR loop in C++ for CBSE class 11 & 12

We have 3 types of loop in C++ : for loop, while loop and the do-while loop. In the previous post, we had discussed the basics of the while and do-while loop. Now let us see what a ‘for loop‘ is and how it works. Like all other loops, for loop also executes a statement or a group of statements repeatedly. Its syntax is: for(initialization expression,test expression,increment expression) { statement(s); ...