What syntax is used for initializing multiple variables in C?

In C, you can initialize multiple variables in a single statement by separating them with commas. Here’s the syntax:

data_type variable1 = value1, variable2 = value2, variable3 = value3;

For example:

int a = 5, b = 10, c = 15;

This initializes three integer variables a, b, and c with values 5, 10, and 15, respectively.

0 Comments

no data
Be the first to share your comment!