KEMBAR78
Fundamentals of c programming | PPTX
Fundamentals of C Programming
Chitrank Dixit
Characters used in C
Alphabets
Uppercase letters A to Z
Lowercase letter a to z
Numbers
0 to 9
+ plus , comma < less than
- minus . full stop > greater than
* asterisk ; semicolon = equal to
/ slash : colon ( open parenthesis
 back slash ' apostrophe ) close parenthesis
% percent " double quote [ open bracket
| vertical bar & ampersand ] close bracket
~ tilde # hash { open set bracket
? question mark $ dollar } close set bracket
! exclamation mark ^ caret _ underscore
Special characters
Identifier
An identifier is a name having a few letters , numbers and special character
_(underscore). It is used to identify a variable, function, symbolic constant and so on.
An identifier can be written with a maximum of 31 characters. It is a good practice to
have identifiers with few letters; less than 8 letters is commonly followed with the first
letter being an alphabet.
Example
x2 , sum (can be used as variables)
calcu_avg , matadd (can be used as function names)
pi, sigma (can be used as symbolic constants)
Keywords or Reserved Words
C language uses the following keywords which are not available to users to use
them as variables/function names. Keywords are always written with the lower
case letters. Some C compilers use more keywords which they include in their
documentation or manual pages.
auto default float register struct
volatile break do for return
switch while case double goto
short typedef char else if
signed union const enum int
sizeof unsigned continue extern long
static void
Tokens
C program has some punctuation marks, keywords and operators as the smallest
individual units and are referred to as C tokens. Following six types of tokens are used in
C language.
C tokens Example
Keywords auto, break , etc
Constants -25 , 3.15 , etc
Identifiers calcu_avg , sum , etc
String literals “Total Amount Rs. ”
Operators + , - , * , etc
Separators ' ; :

Fundamentals of c programming

  • 1.
    Fundamentals of CProgramming Chitrank Dixit
  • 2.
    Characters used inC Alphabets Uppercase letters A to Z Lowercase letter a to z Numbers 0 to 9
  • 3.
    + plus ,comma < less than - minus . full stop > greater than * asterisk ; semicolon = equal to / slash : colon ( open parenthesis back slash ' apostrophe ) close parenthesis % percent " double quote [ open bracket | vertical bar & ampersand ] close bracket ~ tilde # hash { open set bracket ? question mark $ dollar } close set bracket ! exclamation mark ^ caret _ underscore Special characters
  • 4.
    Identifier An identifier isa name having a few letters , numbers and special character _(underscore). It is used to identify a variable, function, symbolic constant and so on. An identifier can be written with a maximum of 31 characters. It is a good practice to have identifiers with few letters; less than 8 letters is commonly followed with the first letter being an alphabet. Example x2 , sum (can be used as variables) calcu_avg , matadd (can be used as function names) pi, sigma (can be used as symbolic constants)
  • 5.
    Keywords or ReservedWords C language uses the following keywords which are not available to users to use them as variables/function names. Keywords are always written with the lower case letters. Some C compilers use more keywords which they include in their documentation or manual pages. auto default float register struct volatile break do for return switch while case double goto short typedef char else if signed union const enum int sizeof unsigned continue extern long static void
  • 6.
    Tokens C program hassome punctuation marks, keywords and operators as the smallest individual units and are referred to as C tokens. Following six types of tokens are used in C language. C tokens Example Keywords auto, break , etc Constants -25 , 3.15 , etc Identifiers calcu_avg , sum , etc String literals “Total Amount Rs. ” Operators + , - , * , etc Separators ' ; :