OneBite.Dev - Coding blog in a bite size

assign multiple variables in C

Code snippet on how to assign multiple variables in C

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

This code assigns three variables: a, b, and c. The first line “int a, b, c;” declares the variables as type int (integer), which is a data type that holds whole numbers. The next three lines, “a = 5;” “b = 10;” and “c = 15;” assign values to the variables. After this code is executed, a will be 5, b will be 10, and c will be 15.

c