Day 15

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); 

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); 


And this was for today

Thanks

Comments

Popular posts from this blog

Day 2 Talking about computer science 💻

Day 5💻

Day 12 “C comments”