What is a variable in C language

What is a variable in C language       

Variable is a box which stores the values

Always use meaningful names for variables to reduce confusion in the code with names

Remember: to fully define a variable, one need to mention not only its data type but also its storage class

Declaring  variables

A variable has to be declared first to use

Rendered by QuickLaTeX.com

Initializing variables

Rendered by QuickLaTeX.com

Numeric  variables

The numeric variables which we can use in C are first of all, Integer values. second, Floating point values. third, In C, we can use four modifiers

 With numeric  variables, we can use the four modifiers

Character  variables

Rendered by QuickLaTeX.com

Rendered by QuickLaTeX.com

constant is variable and its values does not change. next, constant variables used for fixed values ( pi=3.14;)

Always make meaningful variable names

suppose if you are making a banking system it is advisable to create meaningful names to avoid confusion and complexity

Rendered by QuickLaTeX.com

Rules for variables name creation

  1. a  variable name should be any combination of 1 to 31 alphabets, underscores
  2. the first character of a variable should be an alphabet or an underscore(_)
  3. there should not be any blank space or commas in the variable name
  4. there should not be any special symbol except underscore

What are literals and identifiers in a programming language?

In programming language constants are called literals and variables are called identifiers

consider a constant variable is box whose values are fixed. and a variable is a box whose values can be changed.

related posts

Mohammed Anees

Hey there, welcome to aneescraftsmanship I am Mohammed Anees an independent developer/blogger. I like to share and discuss the craft with others plus the things which I have learned because I believe that through discussion and sharing a new world opens up

Leave a Reply

Your email address will not be published.