C++Constant|Constant and Variable Difference |Tutorial 8| For Beginners |E3 School-2020

Constant 
Constant means Permanent variables
Value only One Time Assign not to change other time
Constant means unchangeable and read-only variable.
Constant Sntaxy
const data_type  identifier = value;
const          👉👉👉👉👉  const
data_type   ðŸ‘‰ðŸ‘‰ðŸ‘‰ðŸ‘‰ðŸ‘‰  int
identifier    👉👉👉👉👉  x
value          👉👉👉👉👉  12

Different Between Constant and Variables

Constant Variables
A constant does not change its value over time. A variable, on the other hand, changes its value dependent on the equation.
Constant Only one Time assigns the value not change use other time. Variable any time value assign or any time change value.
Constant read-only. Variable read and change value.
Syntax const data_type identifier = value; Only Assign and declare one line . Syntax Data_type Identifier = Value;
Only Assign and declare one line. Other Data_type identifier; Identifier = value;
Program
#include<iostream>
using namespace std;
main()
{
const int my = 20;
const float me= 10;

court<<my<<endl;
court<<me<<endl;

return 0;

}
Note: Explain all the code in this video.So watch this video.
Watch Video

C++ Tutorial 8 Slide

Free Learning Point

1 / 7
C++ Tutorial 8 For beginner
2 / 7
Constant
3 / 7
Constant Syntax
4 / 7
Difference Between Constant and Variable
5 / 7
Watch Video
6 / 7
Understand
7 / 7
Please Support Me

Post a Comment

Virtually nothing is impossible in this world if you just put your mind to it and maintain a
positive attitude.

Previous Post Next Post