What is the variable in Programming

Did you know what is the variables in computer programming



We know that you will be reading this post because you are a student of any Branch which is related to computer science or business or your interest in computers.


Well , Today we are going to learn about what are the variables ? It is a key concept of each programming language. Without variables we aren't able to save the values in memory. Memory is the key part of each computer. Without memory it's not possible to run a program.


Come to the point, variable is the any alfabet between A to Z or any combination of letters, which stores the input and output results in memory are called variables.


Understanding what's the variable it's little bit easy for those who are already taking computer science as an optional subject in 12th std. But those who are new to computer science should take some time to understand it.


But don't worry We will 100% explain to you.

As we know computer memory or memory of mobile phones is used for storing Data, like images, articles or documents, video's and many other databases.


The main purpose of the variable is the storing given inputs and generated outputs in the memory. 


Let's take an example: we have to add two numbers using C++ programming then we need data like two numbers (any numbers). For example we have to add 2 and 3 and we have to store that result in a C variable. The equation will be following


C=a+b; 


Here C is the output variable which stores the result of a+b execution. Here a and b are 2 and 3.

Using this equation we will write as following


c=2+3;


When this code executed by the computer we get output :


C=5 ;


This output shown on the screen after running the code.

 

In short "variable is the alphabet or combination of alphabets which store assigned value in the memory for execution."




See next c program

Comments