SlideShare a Scribd company logo
Introduction to C
By
Naveen Kumar .V
Introduction to C
C is a general purpose, procedural, structured computer
programming language developed by
Dennis Ritchie in the year 1972 at AT&T Bell Labs.
C language was developed on UNIX and was invented
to write UNIX system software.
C is a successor of B language.
• C was initially developed for writing system software
• Many other commonly used programming languages such as
C++ and Java are also based on C.
There are different C standards: K&R C std, ANSI C, ISO C.
Characteristics of C
High-Level Language: C allows programmers to focus on solving
problems without worrying about machine code.
Small Size: C has only 32 keywords, making it relatively easy to learn.
Function Calls: C uses function calls extensively, which helps organize
code and make it reusable.
Structured Programming: C supports structured programming,
allowing users to break down problems into smaller modules that
combine to form a complete program.
Loose Typing: Unlike some languages, C allows variables to be
treated as different types (e.g., a character can be treated as an
integer).
Stable Language: C is known for its reliability and stability in software
development.
Fast and Efficient: C programs use operators and data types
effectively, resulting in quick execution.
Low-Level Programming: C enables bitwise operations, allowing
for detailed control over hardware.
Portability: C programs can run on different computers with
little or no changes, making it a portable language.
A C program contains one or more functions
• The statements in a C program are written in a logical
sequence to perform a specific task.
• Execution of a C program begins at the main() function
• You can choose any name for the functions.
• Every program must contain one function that has its
name as main().
Where, #include refers to the preprocessor statement
used for the standard input/output functions and it
starts with the hash (#) symbol.
main( ):- Refers to the function from where the
execution of the program begins.
Source code file
• A source code is a list of commands that has to be assembled
or compiled into an executable computer program.
• The source code file contains the source code of the program.
The file extension of any C source code file is “.c”.
• This file contains C source code that defines the main function
and maybe other functions.
• The main() is the starting point of execution when you
successfully compile and run the program.
• A C program in general may include even other source code
files (with the file extension .c).
Header file
• When working with large projects, it is often desirable to
make sub-routines and store them in a different file known as
header file. The advantage of header files can be realized when
a) The programmer wants to use the same subroutines in
different programs.
b) The programmer wants to change, or add, subroutines, and
have those changes be reflected in all other programs.
• Conventionally, header files names ends with a “.h” extension
and its name can use only letters, digits, dashes, and
underscores.
• While some standard header files are available in C, but the
programmer may also create his own user defined header files
Standard Header file
Examples of standard header files are:
1. string.h: for string handling functions.
2. stdlib.h: for some miscellaneous functions.
3. stdio.h: for standardized input and output functions.
4. math.h: for mathematical functions
5. alloc.h: for dynamic memory allocation.
6. conio.h: for clearing the screen
Object Files:
• Object files are generated by the compiler as a result of
processing the source code file.
• Object files contain compact binary code of the function
definitions.
• Linker uses this object file to produce an executable file (.exe
file) by combining the of object files together.
• Object files have a “.o” extension, although some operating
systems including Windows and MS-DOS have a “.obj”
extension for the object file.
Binary Executable File
• The binary executable file is generated by the linker.
• The linker links the various object files to produce a binary file
that can be directly executed.
• On Windows operating system, the executable files have
“.exe” extension
C tokens
• Tokens are the basic building blocks in C language.
• It is the smallest individual unit in C program.
• A program is constructed using a combination of these
tokens. 6main types of tokens in C are:
4. White space characters: These characters are used to print a
blank space on the screen like b, t, v, r, f, n.
5. Escape sequences.
Character set in C
• In C, character means any letter from English alphabet, a digit
or a special symbol used to represent information.
• The character set of C can therefore be given as:
1. English alphabet: Include both lower case (a-z) as well upper
case (A-Z) letters.
2. Digits: Include numerical digits from 0 to 9.
3. Special characters: Include symbols such as ~, @, %, ^, &, *, {,
}, <, >, =, _, +, -, $, /, (, ), , ;, : , [, ], ‘, “, ?, ., !, |
Keywords
• C has a set of 32 reserved words often known as keywords.
• All keywords are basically a sequence of characters that have
a fixed meaning.
• By convention all keywords must be written in lowercase
(small) letters.
• It can be of any reasonable length.
Though it should not contain more than 31 characters.
Identifiers
Identifiers are names given to program elements such as
variables, arrays and functions.
Rules for forming identifier name
1. It cannot include any special characters or punctuation marks
(like #, $, ^, ?, ., etc) except the underscore"_".
2. There cannot be two successive underscores
3. Keywords cannot be used as identifiers
4. The names are case sensitive. So, example, “FIRST” is
different from “first” and “First”.
5. It must begin with an alphabet or an underscore.
Introduction to C which deals with the basics of C

More Related Content

PPTX
Basics of C Lecture 2[16097].pptx
PPTX
prateek verbal computer language 2024 .pptx
PPTX
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
PPTX
PPTX
PPTX
CHARACTERISTICS OF C (1).pptxtejwueghhehe
PPT
8844632.ppt
PPTX
C programming presentation(final)
Basics of C Lecture 2[16097].pptx
prateek verbal computer language 2024 .pptx
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
CHARACTERISTICS OF C (1).pptxtejwueghhehe
8844632.ppt
C programming presentation(final)

Similar to Introduction to C which deals with the basics of C (20)

PDF
Introduction to C Programming | Importance of Learning C
PPTX
overview of c, history, structure, data types, tokens in c, constants, variab...
PPT
490450755-Chapter-2.ppt
PPT
490450755-Chapter-2.ppt
PPTX
Csc240 -lecture_3
PPT
358 33 powerpoint-slides_1-introduction-c_chapter-1
PPTX
Programming in C - Introduction to C Language
PPTX
C Programming UNIT 1.pptx
PDF
Basics of C Prog Lang.pdf
PDF
Introduction to C programming
PPTX
structure of a c program - slideshare.pptx
PPTX
Cpu.ppt INTRODUCTION TO “C”
PPTX
C lang7age programming powerpoint presentation
PDF
C class basic programming 1 PPT mayanka (1).pdf
PPTX
Unit-2_Getting Started With ‘C’ Language (3).pptx
PPSX
Lecture 2
PPTX
C programming slide day 01 uploadd by md abdullah al shakil
PPTX
Unit-1_c.pptx you from the heart of the day revision
PPTX
Unit-1 (introduction to c language).pptx
PPTX
C PROGRAMMING LANGUAGE.pptx
Introduction to C Programming | Importance of Learning C
overview of c, history, structure, data types, tokens in c, constants, variab...
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
Csc240 -lecture_3
358 33 powerpoint-slides_1-introduction-c_chapter-1
Programming in C - Introduction to C Language
C Programming UNIT 1.pptx
Basics of C Prog Lang.pdf
Introduction to C programming
structure of a c program - slideshare.pptx
Cpu.ppt INTRODUCTION TO “C”
C lang7age programming powerpoint presentation
C class basic programming 1 PPT mayanka (1).pdf
Unit-2_Getting Started With ‘C’ Language (3).pptx
Lecture 2
C programming slide day 01 uploadd by md abdullah al shakil
Unit-1_c.pptx you from the heart of the day revision
Unit-1 (introduction to c language).pptx
C PROGRAMMING LANGUAGE.pptx
Ad

More from neonaveen (8)

PPT
introduction to cryptography (basics of it)
PPTX
Digital_signature[1]and its basics .pptx
PPTX
digital signature and its creations.pptx
PDF
Python list manipulation basics in detail.pdf
PPT
VM_2024_21.12.23 final.ppt
PDF
Database Management Systems Question Paper.pdf
PDF
ch01.pdf
PDF
Overview of computers Questions.pdf
introduction to cryptography (basics of it)
Digital_signature[1]and its basics .pptx
digital signature and its creations.pptx
Python list manipulation basics in detail.pdf
VM_2024_21.12.23 final.ppt
Database Management Systems Question Paper.pdf
ch01.pdf
Overview of computers Questions.pdf
Ad

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Classroom Observation Tools for Teachers
PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Pharma ospi slides which help in ospi learning
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
master seminar digital applications in india
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Sports Quiz easy sports quiz sports quiz
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Renaissance Architecture: A Journey from Faith to Humanism
Microbial diseases, their pathogenesis and prophylaxis
Microbial disease of the cardiovascular and lymphatic systems
Classroom Observation Tools for Teachers
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPH.pptx obstetrics and gynecology in nursing
Anesthesia in Laparoscopic Surgery in India
Pharma ospi slides which help in ospi learning
VCE English Exam - Section C Student Revision Booklet
master seminar digital applications in india
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
TR - Agricultural Crops Production NC III.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
STATICS OF THE RIGID BODIES Hibbelers.pdf
Sports Quiz easy sports quiz sports quiz

Introduction to C which deals with the basics of C

  • 2. Introduction to C C is a general purpose, procedural, structured computer programming language developed by Dennis Ritchie in the year 1972 at AT&T Bell Labs. C language was developed on UNIX and was invented to write UNIX system software. C is a successor of B language. • C was initially developed for writing system software • Many other commonly used programming languages such as C++ and Java are also based on C. There are different C standards: K&R C std, ANSI C, ISO C.
  • 3. Characteristics of C High-Level Language: C allows programmers to focus on solving problems without worrying about machine code. Small Size: C has only 32 keywords, making it relatively easy to learn. Function Calls: C uses function calls extensively, which helps organize code and make it reusable. Structured Programming: C supports structured programming, allowing users to break down problems into smaller modules that combine to form a complete program. Loose Typing: Unlike some languages, C allows variables to be treated as different types (e.g., a character can be treated as an integer). Stable Language: C is known for its reliability and stability in software development.
  • 4. Fast and Efficient: C programs use operators and data types effectively, resulting in quick execution. Low-Level Programming: C enables bitwise operations, allowing for detailed control over hardware. Portability: C programs can run on different computers with little or no changes, making it a portable language.
  • 5. A C program contains one or more functions • The statements in a C program are written in a logical sequence to perform a specific task. • Execution of a C program begins at the main() function • You can choose any name for the functions. • Every program must contain one function that has its name as main(). Where, #include refers to the preprocessor statement used for the standard input/output functions and it starts with the hash (#) symbol. main( ):- Refers to the function from where the execution of the program begins.
  • 6. Source code file • A source code is a list of commands that has to be assembled or compiled into an executable computer program. • The source code file contains the source code of the program. The file extension of any C source code file is “.c”. • This file contains C source code that defines the main function and maybe other functions. • The main() is the starting point of execution when you successfully compile and run the program. • A C program in general may include even other source code files (with the file extension .c).
  • 7. Header file • When working with large projects, it is often desirable to make sub-routines and store them in a different file known as header file. The advantage of header files can be realized when a) The programmer wants to use the same subroutines in different programs. b) The programmer wants to change, or add, subroutines, and have those changes be reflected in all other programs. • Conventionally, header files names ends with a “.h” extension and its name can use only letters, digits, dashes, and underscores. • While some standard header files are available in C, but the programmer may also create his own user defined header files
  • 8. Standard Header file Examples of standard header files are: 1. string.h: for string handling functions. 2. stdlib.h: for some miscellaneous functions. 3. stdio.h: for standardized input and output functions. 4. math.h: for mathematical functions 5. alloc.h: for dynamic memory allocation. 6. conio.h: for clearing the screen
  • 9. Object Files: • Object files are generated by the compiler as a result of processing the source code file. • Object files contain compact binary code of the function definitions. • Linker uses this object file to produce an executable file (.exe file) by combining the of object files together. • Object files have a “.o” extension, although some operating systems including Windows and MS-DOS have a “.obj” extension for the object file.
  • 10. Binary Executable File • The binary executable file is generated by the linker. • The linker links the various object files to produce a binary file that can be directly executed. • On Windows operating system, the executable files have “.exe” extension
  • 11. C tokens • Tokens are the basic building blocks in C language. • It is the smallest individual unit in C program. • A program is constructed using a combination of these tokens. 6main types of tokens in C are: 4. White space characters: These characters are used to print a blank space on the screen like b, t, v, r, f, n. 5. Escape sequences.
  • 12. Character set in C • In C, character means any letter from English alphabet, a digit or a special symbol used to represent information. • The character set of C can therefore be given as: 1. English alphabet: Include both lower case (a-z) as well upper case (A-Z) letters. 2. Digits: Include numerical digits from 0 to 9. 3. Special characters: Include symbols such as ~, @, %, ^, &, *, {, }, <, >, =, _, +, -, $, /, (, ), , ;, : , [, ], ‘, “, ?, ., !, |
  • 13. Keywords • C has a set of 32 reserved words often known as keywords. • All keywords are basically a sequence of characters that have a fixed meaning. • By convention all keywords must be written in lowercase (small) letters. • It can be of any reasonable length. Though it should not contain more than 31 characters.
  • 14. Identifiers Identifiers are names given to program elements such as variables, arrays and functions. Rules for forming identifier name 1. It cannot include any special characters or punctuation marks (like #, $, ^, ?, ., etc) except the underscore"_". 2. There cannot be two successive underscores 3. Keywords cannot be used as identifiers 4. The names are case sensitive. So, example, “FIRST” is different from “first” and “First”. 5. It must begin with an alphabet or an underscore.