You are on page 1of 34

Language

• It is a communication channel between

Person to Person
Person to Machine

Note: Exchange Our


Ideas
Feelings
Emotions
Machine to Machine with each other
Natural Languages

Person to Person

Ex:
English
Te l u g u
Hindi
Urdu
Ta m i l e t c . .
Programming Languages

Person to Computer Ex:


C
C++
JAVA
Python
Learning Programming Language and Natural Language: An Analogy

Programming Language

Natural Language
• Writing a C program is similar to writing an essay
in English.
Recall all the stages through which you have undergone in the
process of learning how to write an essay in English.

Your teacher must have told you:


1. How to learn characters in English
2. How to create words from letters.
3. How to form sentences using words and grammar.
4. How to organize sentences and create paragraphs.
5. How to arrange paragraphs and write an essay.
Steps to learn English….
1. How to learn characters in English.
2. How to create words from letters.
3. How to form sentences using words and grammar.
4. How to organize sentences and create paragraphs.
5. How to arrange paragraphs and write an essay.
Steps to learn C Programming Language…..

1. How to learn characters in C Language.

Note: This is similar to learning characters in a


natural language.
2. How to create identifiers using the characters
available in the character set of C language.

Note: This is similar to creating words in a


natural language.
3. How to use identifiers to form expressions,
which can be further converted to statement,
the smallest logical unit of a program.

Note: Forming a statement is similar to forming


a sentence.
4. How to use statements to write functions.

Note: Writing a function is similar to writing a


paragraph.
5. How to use functions to create a program.

Note: This is similar to creating an essay from


paragraphs.
C Language Preliminaries

• C Character Set
• Keywords 
• Identifiers 
• Constants 
• Variables 
• Data types 
C Character Set

• The basic source character set of C language


includes:
a.      Alphabets
                                b.      Digits
                                c.      Special Characters
                                d.      White Spaces
ALPHABETS

Uppercase letters                 A, B, C, D, ……..Z


Lowercase letters                 a, b, c, d, ……..z

           
DIGITS    

0, 1, 2, 3, 4, 5, 6, 7, 8, 9
SPECIAL CHARACTERS
 ~          tilde                            ′           apostrophe               
%         percent sign              
|           vertical bar         :           colon                 
@        at symbol               [           left bracket           
+          plus sign      
-           minus sign      ]           right bracket         
*          asterisk                          "          quotation mark        
<          less than
>          greater than     
;           semicolon
_          underscore                             
 ^          caret                       
#          number sign             
!           exclamation mark    
=          equal to ,           comma               
&         ampersand                
$          dollar sign                        
{ left flower brace  
(           left parenthesis      }            right flower brace    
)           right parenthesis             
            
\           back slash
/           slash           ?            Question mark      
    
.           dot operator           
WHITESPACE CHARACTERS
C Program

main()
{
int a;
Used to write the source a=2;
Program
C Character Set printf(“a=%d”, a);
}
a.  Alphabets
b.  Digits
c.  Special Characters
d.  White Spaces
• If you know C's source character set, the next
step is keywords & identifiers.
Keywords

• The keywords are also called ‘Reserved words’.


• Keywords are the words whose meaning has
already been explained to the C compiler and
their meanings cannot be changed i.e., The
meaning of a keyword is predefined.
• Keywords serve as basic building blocks for
program statements.
• A keyword cannot be used as an identifier
name in C language.
• All keywords must be written in lowercase.
• 32 keywords available in C.
The below table shows a set of keywords present in C language.

List of Keyword in C
Thank U.....

You might also like