Loading...
Utilizor Digital Network Hub
Productivity Engines
Development Global Reach
Local Ranking Ecosystems
Utilizor Programmatic SEO Network © 2026 | All Rights Reserved | Precision Engineering
Loading...
Utilizor Programmatic SEO Network © 2026 | All Rights Reserved | Precision Engineering
Storing data.
Variables are containers for storing data values, like numbers and characters.
In C, there are different types of variables (defined with different keywords), for example:
int - stores integers (whole numbers), without decimals, such as 123 or -123float - stores floating point numbers, with decimals, such as 19.99 or -19.99char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotesTo create a variable, specify the type and assign it a value:
type variableName = value;
Format specifiers are used together with the printf() function to tell the compiler what type of data the variable is storing. It is basically a placeholder for the variable value.
%d or %i - prints an integer%f - prints a float%c - prints a character%s - prints a string (text)c examplec examplec examplec example