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...
-
<%@page contentType="text/html" import="java.util.*" %> <!-- http://www.roseindia.net/jsp --> ...
-
So far we’ve learnt how to select data from a database table and how to insert and update data into a database table. Now it’s time to learn...
-
Introduction: In this exercise, you will exercise the concept scope variable. Steps to follow: 1. Write ScopeOfVariable.java as shown in Cod...
-
The SQL UPDATE general syntax looks like this: UPDATE Table1 SET Column1 = Value1, Column2 = Value2 WHERE Some_Column = Some_Value The SQL U...
-
The SQL DISTINCT clause is used together with the SQL SELECT keyword, to return a dataset with unique entries for certain database table col...
-
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...
-
What Is Visual Basic and Why do I need it? Visual Basic is Easy to learn Programming language. With Visual Basic you can develop Windows bas...
No comments:
Post a Comment