KEYWORDS, COMMENTS AND TYPE CASTING
Keywords:
The words given by programming language having predefined meaning and uses are called reserve words or key words. These words cannot be used for any other purpose. There are 32 reserve words in c language.
Example: int, float, long double etc.
The words given by programming language having predefined meaning and uses are called reserve words or key words. These words cannot be used for any other purpose. There are 32 reserve words in c language.
Example: int, float, long double etc.
Comments:
Comments are the non executable statements.They doesn't affect the size of program.comments are use to explain the code of program.They increase program readability and understanding.They also help in modifying and debugging of program.There are two ways of writing comment.
Comments on single line are added by using double slash "//".
Example:
//practice makes a man perfect.
Multi line comment:
Comments on multi line are added by placing /* at the beginning of comment,The character */ is used to end multi-line comment.
Example:
/*practices makes
a man perfect.*/
Type Casting :
Type casting is the process by which one type of data is converted into another type of data.
Types of type casting
● Implicit
● Explicit
Implicit Type Casting
It is performed by compiler itself. Operands in arithmetic operation must be of similar types. If the data types of operands is different than 'lower' type will automatically convert itself to the 'higher' type before the expression is evaluated and the output will be of 'higher' type.
Explicit Type Casting:
Explicit type casting is performed by cast operator.The cast operator tells the computer to convert data type of a value.
Syntax: of using cast operator is
(type) expression;
Comments are the non executable statements.They doesn't affect the size of program.comments are use to explain the code of program.They increase program readability and understanding.They also help in modifying and debugging of program.There are two ways of writing comment.
- Single line
- Multiple line
Comments on single line are added by using double slash "//".
Example:
//practice makes a man perfect.
Multi line comment:
Comments on multi line are added by placing /* at the beginning of comment,The character */ is used to end multi-line comment.
Example:
/*practices makes
a man perfect.*/
Type Casting :
Type casting is the process by which one type of data is converted into another type of data.
Types of type casting
● Implicit
● Explicit
Implicit Type Casting
It is performed by compiler itself. Operands in arithmetic operation must be of similar types. If the data types of operands is different than 'lower' type will automatically convert itself to the 'higher' type before the expression is evaluated and the output will be of 'higher' type.
Explicit Type Casting:
Explicit type casting is performed by cast operator.The cast operator tells the computer to convert data type of a value.
Syntax: of using cast operator is
(type) expression;