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
-
Now I will show you how to retrieve the data posted from a HTML file in a JSP page. Consider an html page that prompts the user to enter his...
-
Declaration of variables In order to use a variable in C++, we must first declare it specifying which data type we want it to be. The syntax...
-
SYMBOLIC CONSTANTS OR MACRO: In this #define is a macro used for a constant value to be assigned in the program. for example: pi its value i...
-
2.2 Automatic Memory Management The Common Language Runtime does more for your C# and .NET managed executable than just JIT compile ...
-
INTRODUCTION TO 'C': C is a programming language developed at AT & T's Bell laboratories of USA in 1972.it was designed by d...
-
Introduction: In this exercise, you are going to build and run a sample Java program called CommandLineusing NetBeans. The sample program c...
-
SQL aliases can be used with database tables and with database table columns, depending on task you are performing. SQL column aliases are u...
-
SQL Replication term describes a group of technologies allowing information distribution and mirroring between different databases. SQL repl...
-
JSP pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled ...
-
Preprocessor directives Preprocessor directives are lines included in the code of our programs that are not program statements but directive...
No comments:
Post a Comment