C++ 06 Declare Multiple Variables
C++ 06 Declare Multiple Variables
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Example
int x = 5, y = 6, z = 50;
cout << x + y + z;
Try it Yourself »
Example
int x, y, z;
x = y = z = 50;
https://www.w3schools.com/cpp/cpp_variables_multiple.asp 1/5
1/28/24, 9:45 PM C++ Declare Multiple Variables
cout << x + y + z;
Tutorials Exercises Services Sign Up Log in
Try itCSS
HTML YourselfJAVASCRIPT
» SQL PYTHON JAVA PHP HOW TO W3.CSS C
ADVERTISEMENT
Ads by
https://www.w3schools.com/cpp/cpp_variables_multiple.asp 2/5
1/28/24, 9:45 PM C++ Declare Multiple Variables
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
COLOR PICKER
ADVERTISEMENT ADVERTISEMENT
https://www.w3schools.com/cpp/cpp_variables_multiple.asp 3/5
1/28/24, 9:45 PM C++ Declare Multiple Variables
HTML
CSS
SPACES
JAVASCRIPT SQL
UPGRADE
PYTHON JAVA
AD-FREE
PHP HOW TO W3.CSS C
FORUM ABOUT
W3Schools is optimized for learning and training. Examples might be simplified to
improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we
cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of
use, cookie and privacy policy.
https://www.w3schools.com/cpp/cpp_variables_multiple.asp 4/5
1/28/24, 9:45 PM C++ Declare Multiple Variables
W3.CSS.
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
https://www.w3schools.com/cpp/cpp_variables_multiple.asp 5/5