Menu
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

C Declare Multiple Variables


Declare Multiple Variables

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

Example

int x = 5, y = 6, z = 50;
printf("%d", x + y + z);
Try it Yourself »

You can also assign the same value to multiple variables of the same type:

Example

int x, y, z;
x = y = z = 50;
printf("%d", x + y + z);
Try it Yourself »