Notice: session_start(): A session had already been started - ignoring in /home/u614325693/domains/onedoubt.com/public_html/post.php on line 3
Declare Multiple Variables - ONEDOUBT.COM

C++ Declare Multiple Variables


Declare Many Variables

To declare more than one variable of the same type, use a comma-separated list:

Example

int x = 5, y = 6, z = 50;
cout << x + y + z;

One Value to Multiple Variables

You can also assign the same value to multiple variables in one line:

Example

int x, y, z;
x = y = z = 50;
cout << x + y + z;


Declare Multiple Variables

Login
ADS CODE