ionos

Thursday, January 7, 2021

The Character set of ‘C’

C language consists of some characters set, numbers and some special symbols. The character set of C consist of all the alphabets of the English language. C consist of Alphabets a to z, A to Z Numeric 0,1 to 9 Special Symbols {,},[,],?,+,-,*,/,%,! and more The words formed from the character set are building blocks of C and are sometimes known as tokens. These tokens represent the individual entity of language. The following different types of token are used in C programming language 1) Identifiers 2)Keywords 3)Constants 4) Operators

1) Identifiers


A 'C' program consists of two types of elements, user-defined and system-defined. Identifiers is nothing but a name given to these elements. An identifier is a word used by a programmer to name a variable, function, or label. identifiers consist of letters and digits, in any order, except that the first character or label. Identifiers consist of letters and digits if any order, except that the first character must be a letter. Both Upper and lowercase letters can be used.

2)Keywords


  • Keywords are nothing but system defined identifiers.
  •  Keywords are reserved words of the language.
  •  They have a specific meaning in the language and cannot be used by the programmer as variable or constant names
  •  C is case sensitive, which means there must be used as it is
  •  32 Keywords in C Programming 

3)Constants


  • A constant is a value or an identifier whose value cannot be altered in a program. For example: 1, 2.5,
  •  As mentioned, an identifier also can be defined as a constant. eg. const double PI = 3.14
  •  Here, PI is a constant. Basically what it means is that PI and 3.14 are the same for this program.

Integer constants


A integer constant is a numeric constant (associated with number) without any fractional or exponential part. There are three types of integer constants in C programming: 

  •  decimal constant(base 10)
  •  octal constant(base 8)
  •  hexadecimal constant(base 16)
 
Floating-point constants

 A floating-point constant is a numeric constant that has either a fractional form or an exponent form. For example: 2.0,0.0000234,-0.22E-5 

Character constants

 A character constant is a constant which uses single quotation around characters. For example: 'a', 'l', 'm', 'F' 

String constants

String constants are the constants which are enclosed in a pair of double-quote marks. For example: "good" ,"x","Earth is round\n" 

4) Operators


C programming has wide range of operators to perform various operations. For a better understanding of operators, these operators can be classified as: 
  • Arithmetic Operators
  • Increment and Decrement Operators 
  • Assignment Operators
  • Relational Operators
  • Logical Operators
  • Conditional Operators
  • Bitwise Operators
  • Special Operators

Featured Post

Payza integration

Payza's Advanced Button in HTML Using simple HTML, you can integrate easily with Payza.Generate buttons and manage payment details f...

Most Popular