09 - Variables in C++ | Things You Are in Dire Need of Knowing (Hindi/Urdu)

Variables in C++

In this video, we are going to see variables in C++ in detail. We will learn the rules for naming a variable in C++ and also what keywords/reserved words mean in C++. At the end of the video, we will learn an interesting fact about number systems and the things we have to take into account while assigning decimal numbers to integral/floating-point numbers. You will also learn the naming rules for a cpp variable.

Series playlist ▶︎ https://youtube.com/playlist?list=PLt4rWC_3rBbWnDrIv4IeC4Vm7PN1wvrNg 

Source Code:

#include <iostream>
using namespace std;

int main(){

    int rollNumber = 1010;

    cout<< "My roll number is " << rollNumber << endl;

    return 0;
}

/* 

            RULES FOR NAMING A C++ VARIABLE

    1. Variable name must not start with a number.
    2. Variable names can not consist of special characters
    3. Variable name must start with an alphabet or underscore
    4. Variable names can not be the reserved words (i.e., keywords)
    5. Variable names can not have spaces.

*/

Watch The Video:

Post a Comment

0 Comments