University Recruiting Essentials: How to Make Your Brand Memorable with On-Campus Events
Tokens_C
-
Upload
prabhu-govind -
Category
Education
-
view
220 -
download
0
description
Transcript of Tokens_C
The Evolution Of Programming Languages
To build programs, people use languages that are similar to human language. The program is translated into machine code, which computers understand.
Programming languages fall into three broad categories: • Machine languages• Assembly languages• Higher-level languages
The Evolution of Programming Languages - Machine Languages
• Machine languages (first-generation languages) are the most basic type of computer languages, consisting of strings of numbers the computer's hardware can use.
• Different types of hardware use different machine code. For example, IBM computers use different machine language than Apple computers.
The Evolution of Programming Languages - Assembly Languages
• Assembly languages (second-generation languages) are only somewhat easier to work with than machine languages.
• To create programs in assembly language, developers use cryptic English-like phrases to represent strings of numbers.
• The code is then translated into object code, using a translator called an assembler.
Assemblycode
Assembler
Object code
The Evolution of Programming Languages - Higher-Level Languages
Higher-level languages are more powerful than assembly language and allow the programmer to work in a more English-like environment.
Higher-level programming languages are divided into three “generations," each more powerful than the last:
• Third-generation languages
• Fourth-generation languages
• Fifth-generation languages
Higher-Level Languages - Third-Generation Languages
• Third-generation languages (3GLs) are the first to use true English-like phrasing, making them easier to use than previous languages.
• 3GLs are portable, meaning the object code created for one type of system can be translated for use on a different type of system.
The following languages are 3GLs: FORTAN C COBOL C++ BASIC Java Pascal ActiveX
Fundamentals and History of C
C is developed by Dennis RitchieC is a structured programming languageC supports functions that enables easy
maintainability of code, by breaking large file into smaller modules
Comments in C provides easy readabilityC is a powerful language
HISTORY OF ANSI C
Year Language Developed By/Speciality
1960 ALGOL First Language used block structure
1967 BCPL (Basic Complied Programming Language)
Martin Richards
1970 B Ken Thomson
1972 B,BCPL,ALGOL C
Dennis Ritchie
POINTS TO REMEMBERCase Sensitive • Case matters in C. ‘A’ is not ‘a’• Add plenty of comments (/* */ or //)• Good layout, not: main() {printf("Hello World\n");}• Use meaningful variable names• Initialize your variables• Use parentheses to avoid confusion:a=(10.0 + 2.0) * (5.0 - 6.0) / 2.0
1. Letters: A . . . . Z and a . . . . z .2. Decimal digits: 0 to 93. Special Characters: . , ; : ? ‘ “ ! | / \ ~ ` _ $ % &
^ * - + < > ( ) { } [ ] #White spaces:
Blank spaceHorizontal tabVertical tabCarriage returnNew lineForm feed
Character Set
Smallest individual units like individual words and punctuation marks are called tokens. They are 6 types.
1.Keywords2.Constants3.Identifiers4.Strings5.Characters6.Special symbols
C Tokens
• cannot be used as variable name or function name • written in lowercase
S.No Primitive data types
User Defined data types
Constants Statements
Memory types
Operator
1 char enum const break auto size of
2 double union type def case extern
3 long struct continue register
4 short default static
5 signed do volatile
6 unsigned else
7 void for
8 float goto
9 int if
10 return
11 switch
12 while
Keywords