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.

Wednesday, February 27, 2013

Ques-11: Define identifier and describe the rules of identifier.

The definition of identifier and the rules of identifier is given below.

Solution:

Identifier: The names that are used to reference variables ,functions ,arrays ,labels and various other user-defined objects are called identifiers.


Rules of identifier:

1. An identifier name can vary from 1 to 32 characters.
2. The first character must be a letter or an underscore( _ ) with subsequent characters.
3. An identifier name cannot be the same as a C keyword and it should not have the same name as functions that are in the C library.
4. Must not contain white space.
5. In C,uppercase and lowercase are treated differently .Hence, count,Count and COUNT are three different identifier name.