Recent Posts

Saturday 23 December 2017

Variable


If you want to learn programming you must know variableconstantkeywords ,data type and operators in C language.In the previous post we have learn what is constants and type of constants.In this post we will learn Variable.as we know that variable, constant and keyword are the part of the syntax.


  • what is character in C and 
  • what is identifier in C
  • Variable 

C Character set

A character denotes any alphabet, digit or special symbol used to represent information.

Identifier in C

In C programming language identifier is a name given to variable, structure, union, function.The name can contain alphabets digits as shown in above table.

For example
int number;

Here in the above example number is a identifier which denote the variable of integer data type.

Variable:

A value which may change during program execution is called a variable.Variable is nothing but a name to specific location in the memory of computer where different constant are stored.These locations can contain data type as integer,float,character constants.Variable also allows Variable is a container that hold the  value of data type.

Syntax of variable

type variable_list;

Here in the above example type is a data type of c programming language and variable list is a list of variables which are separated by commas.

For example
int    a,b,c;
float  f;
char  c,ch;
double d;

The line a,b,c declare and define the variable a , b and c and which instruct the compiler to create Variable of data type int.
We can initialize the value of Variables at the time of declaration as follows

type variable_name=value;






0 comments:

Post a Comment

Followers

Popular Posts

Categories

social media

Text Widget

Powered by Blogger.

About Me

My name is junaid khan and i am a full time blogger and author of a blog tutorial called tutorialpointsolution.

String function

In the previous post we learn about what is String .we know that string is a collection of two or more characters.In string we can store al...

Search This Blog

Technology

Adbox

Recent Post

Breaking

Recent In Internet

Comments

Facebook

Pages

Comments

Pages

Recent

Pages

Technology