# C language.

C language is a popular programming language that is widely used in developing software, applications and operating systems.

One of the fundamental concepts of the C language is variables. In this article, we will discuss the basics of C language variables, their types and how to use them.

### What is a variable in C language?

In simple terms, a variable is a container that stores a value in a computer's memory, just like how our brain stores information, how a container carries whatever is been placed inside of it. going deeper brings us to understanding data storage in C

What happens when you declare a variable?

In a computer memory when you declare a variable `var` the computer looks for an available memory address to allocate to that variable. Once a memory address has been allocated, the variable is linked to that memory address.

When you assign a value to the variable, the computer stores that value in the memory address associated with the variable. Whenever the program needs to access the value of the variable, it can retrieve the data from the memory address where it is stored.

### How to declare a variable in C.

To declare a variable in C we include the datatype, and name of the variable followed by a semi-colon to end the statement.

declare an integer variable called "age":

```c
int age;
```

Once you have declared a variable, you can assign a value to it using the assignment operator "=":

```c
age = 21;
```

This statement assigns the value 25 to the variable "age".

### Types of variables in C language:

C language has different types of variables, each with its own data type. The basic data types in C are:

* int: used to store integer values (e.g., 1, 2, 3, etc.)
    
* float: used to store floating-point values (e.g., 1.23, 2.45, etc.)
    
* double: used to store double-precision floating-point values (e.g., 1.234567, 2.345678, etc.)
    
* char: used to store a single character (e.g., 'a', 'b', 'c', etc.)
    

### Making use of variables in C language.

In C you can use variables in many ways ranging from storing values to performing mathematical operations and manipulation of data.

here is a practical example of using variables:

```c
int x, y, sum;

x = 5;
y = 10;
sum = x + y;
```

In this example, we declare three integer variables called "x," "y," and "sum." We assign the values 10 and 20 to the variables "x" and "y," respectively. We then use the addition operator "+" to add the values of "x" and "y" and store the result in the variable "sum."

....

Variables are an essential concept in C language, and understanding how to use them is essential.
