Page Nav

HIDE

Grid

GRID_STYLE

Classic Header

{fbt_classic_header}

Latest:

latest

C programming Character sets token types constants

C programming Character sets,  token types, constants are under the basic discussion of C programming. C Character sets IN C programming th...

C programming Character sets token types constants


C programming Character sets,  token types, constants are under the basic discussion of C programming.

C Character sets

IN C programming there is 4 types of 
  1. Letters: Uppercase: A-Z, Lowercase: a-z
  2. Digits: 0-9
  3. Special characters: For example comma (,) , ampersand(&),  -,  +  etc .
  4. White spaces: Blank, Tab, New line etc .

C token types

Individual words and punctuation marks of a passage text are called tokens. As like this we can say, small individual units in C language is called the tokens in C.
There is 6 types of tokens in C language:
  1. Keywords
  2. Identifiers
  3. Constants
  4. Strings
  5. Special symbols
  6. Operators

Keywords

The codes we write in C has some specific words which are saved and has fixed meaning. If we use those as data then program will not work.

Identifiers

Identifiers referred as the names of variables, functions and arrays. Uppercase and lowercase both types of letters can be used as identifiers with numbers. First letter will be a letter must. Usually we use lower case letters in identifiers. For linking two words in long identifiers underscore character is used.

Constants in C

Constants are the values which don’t change during program execution. 
Constants are two types. These are 
  1. Numeric Constants
  2. Character Constants

Numeric constants: Numeric constants are two types. Those are-
  1. Integer constants
  2. Real constants

  1. Integer constants: Integer constants are Decimal integer, octal integer and hexadecimal integer.


  • Decimal integer constants: Decimal integer constants are the set of the digits 0-9.Example: 12, -72, +98, 0

  • Octal integer constants: Octal integer constants is combination of digits from 0 – 7 with a leading 0.Example: 032, 01247, 0, 0567

  • Hexadecimal integer constants: By 0x and 0X produced sequence of digits are Hexadecimal integer constants. They may include alphabets A, B, C, D, E, F or a, b, c,  d, e, f. These represents the numbers 10, 11, 12, 13, 14, 15. Example: 0x, 0x4E, 0Xabc


Real constants: In Real constants quantities are represented by the numbers which contains fractional parts. Real constants are also known as floating point constants. Example: -0.089, 0.678, 456.9, -142.09

Character constants: Character constants contains characters which are enclosed within a pair of single quote marks. These are two types- Single character constants and String constants


  • Single character constants: A single Character constant contain a character which is enclosed within a pair of single quote marks. Example: 'S' , '9', ';', ' '

Strings


String are sequence of multiple characters which are enclosed in double quote marks. Example: "HELLO!", "9421", "9+13", "Please present in time".

Special operators


In array we use [ ] bracket. In functions we use ( ) bracket and { } bracket. Like this a lot of special operators are used in C programs.



No comments