Wednesday, March 27, 2013

Ques: What do you mean by token? Classify the c token?

Solution:


Token: We write a program with a programming language C.Then this program contains some words (a-z,0-9,........),some special words(#,%,.......),bracket,punctuation etc.Every each group is called token.



Classification of C token:

There are six types of token in C.


1.keywords......(do, if, auto,while,.....)

2.identifiers......(num, sum,......) 

3.constants.....(const pi=3.1416)

4.string constants....("bangladesh")

5.operators and expressions.....(a=b+c,....)

6.punctuators......(; , . , .........)

Friday, March 1, 2013

Ques-12:Define keyword or reserved word.What restriction apply to their use?

The definition of keyword or reserved word and restriction apply to their use is given below.

Solution:

Keyword or reserved word: In computer programming ,a keyword or reserved word is a word or identifier that has a particular meaning to the programming language.In C, there are certain reserved word, called keyword that have a standard pre-defined meaning.



Restriction to apply keyword: The keywords can be used only for their intended purpose.They cannot be used as programmer defined identifiers.The keywords are all lowercase.Since uppercase and lowercase character are not equivalent, it is possible to utilize an uppercase keyword as an identifier.Normally,this is not done , as it considered a poor programming practice.