HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

Declare Multiple Variables


C declaring multiple variables refers to the process of specifying and defining multiple variables of the same or different data types in a single statement.

Example

#include

int main() {

int x = 5, y = 6, z = 50;

printf("%d", x + y + z)

return 0;

}


Output


61


Assigning the Same Value to Multiple Variables in C:


Example

#include

int main() {

int x, y, z;

x = y = z = 50;


printf("%d", x + y + z);


return 0;

}


Output


150