CONSTANTS,VARIABLES AND KEYWORDS:
CONSTANTS:
Two types of constants those are:
a)primary constants
b)secondary constants
a)In primary constants they are integer,real,character constants.
b)In secondary constants they are array,pointer,structure,union,enum etc.
VARIABLES:
a variable is a dataname that may be used to store a data value.unlike constants that
remain unchanged during the execution of a program,a variable may take different values at different times during execution.
Rules for constructing variables:
1. they must begin with a letter.some systems permit underscore as the first character.
2.ANSI standard recognizes alenght of 31 characters.however,the lenght should not be normally
more than eight characters,since only the first eight charaters are treated as significant by
many compilers.
3.uppercase and lower case are significant.that is,the variable total is not the same as total or TOTAL.
4.the variable name should not be keyword.
5.white space is not allowed.
example: int a=10;//int is a datatype,a is a variable in which '10' value is stored.
KEYWORDS:
keywords are the words whose meaning has already been explained to the compiler.
this cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword.
some of the keywords are
auto double if static
break else int struct
case enum long switch
char extern near typedef etc
Popular Posts
-
If you want to do something more complex than insert a simple expression, JSP scriptlets let you insert arbitrary code into the servlet meth...
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
The SQL AVG aggregate function selects the average value for certain table column. Have a look at the SQL AVG syntax: SELECT AVG(Column1) FR...
-
The SQL SELECT INTO statement is used to select data from a SQL database table and to insert it to a different table at the same time. The g...
-
Lab exercises and homeworks: * Things to check before you start the lab * Chapter 3 (Class #1, Jan. 16th homework) o Exerc...
-
Polymorphism Polymorphism is one of the crucial features of OOP. It means "one name, multiple forms". It is also called as Overlo...
-
Introduction: In this exercise, you will exercise the concept of pass by reference. Please not that primitive type parameters are passed ...
-
SQL Replication term describes a group of technologies allowing information distribution and mirroring between different databases. SQL repl...
-
Input/Output with files C++ provides the following classes to perform output and input of characters to/from files: * ofstream: Stream c...
-
Structures Structures can be defined as a tool for handling a group of logically related data items. They are user-defined and provide a met...
No comments:
Post a Comment