Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Sunday, December 20, 2009

Variables in ‘C’ and Identifiers in ‘C’

Variables names are used to store a data value. A variable may take different value during program execution. A variable is defined by the user for eg: - marks, total, average, etc.

Rules to construct a variable
Every variable must begin with an alphabet
It may consist of alphabets or digits or the special symbols underscore _ but no other special symbol is allowed in it.
A variable can be maximum 31 character long but many computers recognize only first 8 characters and ignore the remaining characters
Variable can be written in upper case as well as lower case but note that they are not interchangeable. Hence ‘C’ is called as CASE SENSITIVE LANGUAGE for eg: - TOTAL, total, toTal, Total are taken as 4 different variables.
A Variable should not be a keyword.

Note that variables are also called as identifiers



Valid VariableInvalid VariableReasons
name "name" quotation marks not allowed
marks200 marks 200 space is not allowed
total_50total-50'
Single quotation marks not allowed
STUDENTS10 10STUDENTS It can not start with a digit




Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP