SlideShare a Scribd company logo
www.swapnamithra.com
See With "C"
www.swapnamithra.com
Now Play With C And
Become A Professional
www.swapnamithra.com
hiStory
• C is a general purpose language which is very closely
associated with UNIX for which it was developed in
Bell Laboratories.
• Most of the programs of UNIX are written and run
with the help of 'C'.
• Many of the important ideas of 'c' stem are from BCPL
by Martin Richards.
• In 1972, Dennies Ritchie at Bell Laboratories wrote C
Language which caused a revolution in computing
world .
www.swapnamithra.com
hiStory
• From beginning C was intended to be useful for busy
programmers to get things done easily because C is
powerful,dominant and supple language.
Why Name 'C' was given to this language?
1. Many of the ideas of C language were derived and
taken from 'B' language.
2. BCPL and CPL are previous versions of 'B' language.
3. As many features came from B it was named as 'C'.
www.swapnamithra.com
Summary of hiStory
1. B language developed by Ken Thompson
2.
Operating system developed
by C language
UNIX
3.
Developed at AT&T Bell
Laboratories
4.
Creator of Traditional C Dennis Ritchie
5.
Year 1972
www.swapnamithra.com
Structure Of c PrOgramS
• Before going and reading the structure of C programs
we need to have a basic knowledge of the following:
1. C's Character Set
2. C's Keywords
3. The General Structure Of A 'C' Program
4. How To End A Statement
5. Free Format Language
6. Header Files & Library Functions
www.swapnamithra.com
1. c'S character Set
• C does not use every character set and key found on
modern computers . The only characters that C
language uses for its programs are as follows:
A-Z all alphabets
a-z all alphabets
0-9
# % & ! _ {} [] () $$$$ &&&& |
space . , : ; ' $ "
+ - / * =
www.swapnamithra.com
the fOrm Of a c PrOgram
• All C programs will consist of at least one function, but
it is usual (when your experience grows) to write a C
program that comprises several functions.
• The only function that has to be present is the function
called main. For more advanced programs the main
function will act as a controlling function calling other
functions in their turn to do the dirty work! The main
function is the first function that is called when your
program executes.
www.swapnamithra.com
the fOrm Of a c PrOgram
C makes use of only 32 keywords
which combine with the formal
syntax to the form the C
programming language. Note that
all keywords are written in lower
case - C, like UNIX, uses upper
and lowercase text to mean
different things. If you are not sure
what to use then always use
lowercase text in writing your C
programs. A keyword may not be
used for any other purposes. For
example, you cannot have a
variable called auto.
www.swapnamithra.com
The layouT of C Programs
The general form of a C program is as follows (don't worry about what
everything means at the moment - things will be explained later):
pre-processor directives
global declarations
main()
{
local variables to function main ;
statements associated with function main ;
}
www.swapnamithra.com
f1()
{
local variables to function 1 ;
statements associated with function 1 ;
}
f2()
{
local variables to function f2 ;
statements associated with function 2 ;
}
www.swapnamithra.com
 Note the use of the bracket set () and {}. () are used in conjunction with function
names whereas {} are used as to delimit the C statements that are associated with that
function. Also note the semicolon - yes it is there, but you might have missed it! a
semicolon (;) is used to terminate C statements. C is a free format language and long
statements can be continued, without truncation, onto the next line. The semicolon
informs the C compiler that the end of the statement has been reached. Free format
also means that you can add as many spaces as you like to improve the look of your
programs.
 A very common mistake made by everyone, who is new to the C programming
language, is to miss off the semicolon. The C compiler will concatenate the various
lines of the program together and then tries to understand them - which it will not be
able to do. The error message produced by the compiler will relate to a line of you
program which could be some distance from the initial mistake.
www.swapnamithra.com
PreProCessor DireCTives
• C is a small language but provides the programmer with all the tools to be
able to write powerful programs. Some people don't like C because it is too
primitive! Look again at the set of keywords that comprises the C language
and see if you can find a command that allows you to print to the computer's
screen the result of, say, a simple calculation. Don't look too hard because it
doesn't exist.
• It would be very tedious, for all of us, if every time we wanted to
communicate with the computer we all had to write our own output
functions. Fortunately, we do not have to. C uses libraries of standard
functions which are included when we build our programs. For the novice C
programmer one of the many questions always asked is does a function
already exist for what I want to do? Only experience will help here but we
do include a function listing as part of this course.
• All programs you will write will need to communicate to the outside world - I
don't think I can think of a program that doesn't need to tell someone an
answer. So all our C programs will need at least one of C's standard libraries
which deals with standard inputting and outputting of data. This library is
called stdin.h and it is declared in our programs before the main function.
The .h extension indicates that this is a header file.
www.swapnamithra.com
• All pre-processor directives begin with a # and the must start in the first
column. The commonest directive to all C programs is:
#include <stdio.h>
• Note the use of the angle brackets ($$$$ and &&&&) around the header's
name. These indicate that the header file is to be looked for on the system
disk which stores the rest of the C program application. Some text books will
show the above statement as follows:
• #include "stdio.h"
• The double quotes indicate that the current working directory should be
searched for the required header file. This will be true when you write your
own header files but the standard header files should always have the angle
brackets around them.
• NOTE: just to keep you on your toes - pre-processor statements, such as
include, DO NOT use semi-colons as delimiters! But don't forget the # must
be in the first column.
www.swapnamithra.com
THANKYOU
For more tutorials subscribe us .
Visit www.swapnamithra.com

More Related Content

PPTX
Introduction to c language
PPTX
Introduction to C Language
PPTX
Programming in c
PPSX
Introduction of c language
PPTX
introduction to c language
PPT
Introduction to c_language
PPTX
Introduction to C Language
PPT
Programming
Introduction to c language
Introduction to C Language
Programming in c
Introduction of c language
introduction to c language
Introduction to c_language
Introduction to C Language
Programming

What's hot (20)

PDF
C lecture notes new
PPTX
10 lesson6
PPT
270 1 c_intro_up_to_functions
PPTX
Basic programming concepts
PPTX
Introduction to C Language (By: Shujaat Abbas)
PPT
Lect 1. introduction to programming languages
PPTX
Introduction to programming
PPTX
C programming introduction
PPTX
Input output in c
PPSX
Programming Fundamental Presentation
PPTX
Error hanadling in c programming presentation
PPT
Programming assignment help
DOCX
The basics of c programming
DOCX
C Unit 1 notes PREPARED BY MVB REDDY
PPTX
Programming Fundamentals lecture 1
PPTX
Introduction of c programming
PPTX
C programming
PPTX
10 lesson7
PDF
Introduction to Computer Programming
PPTX
Top 10 programming languages
C lecture notes new
10 lesson6
270 1 c_intro_up_to_functions
Basic programming concepts
Introduction to C Language (By: Shujaat Abbas)
Lect 1. introduction to programming languages
Introduction to programming
C programming introduction
Input output in c
Programming Fundamental Presentation
Error hanadling in c programming presentation
Programming assignment help
The basics of c programming
C Unit 1 notes PREPARED BY MVB REDDY
Programming Fundamentals lecture 1
Introduction of c programming
C programming
10 lesson7
Introduction to Computer Programming
Top 10 programming languages
Ad

Viewers also liked (7)

PDF
Learn c programming language in 24 hours allfreebooks.tk
PPTX
Automate_LSF_ppt_final
PPT
Introduction to c programming
PDF
DCA- Basic Fundamental, My computer, Desktop, History of computer
PDF
ITIL Foundation Training
PPTX
ITIL PPT
PPSX
INTRODUCTION TO C PROGRAMMING
Learn c programming language in 24 hours allfreebooks.tk
Automate_LSF_ppt_final
Introduction to c programming
DCA- Basic Fundamental, My computer, Desktop, History of computer
ITIL Foundation Training
ITIL PPT
INTRODUCTION TO C PROGRAMMING
Ad

Similar to Learn C Language (20)

PPTX
Programming in C
PPTX
Programming in C & Decision Making Branching
PPTX
Programming in C and Decision Making Branching
PDF
PPTX
Introduction to c programming
PPTX
C programming
PDF
C class basic programming 1 PPT mayanka (1).pdf
PPTX
Unit-1_c.pptx you from the heart of the day revision
PPTX
chapter 1.pptx
PPTX
PPTX
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
PPTX
PPTX
C programming
PPTX
C session 1.pptx
PPTX
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
PPTX
C++ language basic
PPTX
C programming presentation(final)
PPT
Introduction to Computer
PPTX
C-PROGRAMMING-LANGUAGE.pptx
PPTX
Basics of C Lecture 2[16097].pptx
Programming in C
Programming in C & Decision Making Branching
Programming in C and Decision Making Branching
Introduction to c programming
C programming
C class basic programming 1 PPT mayanka (1).pdf
Unit-1_c.pptx you from the heart of the day revision
chapter 1.pptx
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C programming
C session 1.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
C++ language basic
C programming presentation(final)
Introduction to Computer
C-PROGRAMMING-LANGUAGE.pptx
Basics of C Lecture 2[16097].pptx

Recently uploaded (20)

PDF
UTS Health Student Promotional Representative_Position Description.pdf
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
PPTX
Presentation on Janskhiya sthirata kosh.
PDF
Sunset Boulevard Student Revision Booklet
PDF
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
PPTX
Strengthening open access through collaboration: building connections with OP...
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PPTX
An introduction to Prepositions for beginners.pptx
PPTX
Skill Development Program For Physiotherapy Students by SRY.pptx
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Introduction and Scope of Bichemistry.pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
High Ground Student Revision Booklet Preview
PDF
Landforms and landscapes data surprise preview
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
UTS Health Student Promotional Representative_Position Description.pdf
The Final Stretch: How to Release a Game and Not Die in the Process.
vedic maths in python:unleasing ancient wisdom with modern code
Presentation on Janskhiya sthirata kosh.
Sunset Boulevard Student Revision Booklet
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
Strengthening open access through collaboration: building connections with OP...
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
Open Quiz Monsoon Mind Game Final Set.pptx
An introduction to Prepositions for beginners.pptx
Skill Development Program For Physiotherapy Students by SRY.pptx
NOI Hackathon - Summer Edition - GreenThumber.pptx
Week 4 Term 3 Study Techniques revisited.pptx
Introduction and Scope of Bichemistry.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
High Ground Student Revision Booklet Preview
Landforms and landscapes data surprise preview
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
Cardiovascular Pharmacology for pharmacy students.pptx

Learn C Language

  • 1. www.swapnamithra.com See With "C" www.swapnamithra.com Now Play With C And Become A Professional
  • 2. www.swapnamithra.com hiStory • C is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. • Most of the programs of UNIX are written and run with the help of 'C'. • Many of the important ideas of 'c' stem are from BCPL by Martin Richards. • In 1972, Dennies Ritchie at Bell Laboratories wrote C Language which caused a revolution in computing world .
  • 3. www.swapnamithra.com hiStory • From beginning C was intended to be useful for busy programmers to get things done easily because C is powerful,dominant and supple language. Why Name 'C' was given to this language? 1. Many of the ideas of C language were derived and taken from 'B' language. 2. BCPL and CPL are previous versions of 'B' language. 3. As many features came from B it was named as 'C'.
  • 4. www.swapnamithra.com Summary of hiStory 1. B language developed by Ken Thompson 2. Operating system developed by C language UNIX 3. Developed at AT&T Bell Laboratories 4. Creator of Traditional C Dennis Ritchie 5. Year 1972
  • 5. www.swapnamithra.com Structure Of c PrOgramS • Before going and reading the structure of C programs we need to have a basic knowledge of the following: 1. C's Character Set 2. C's Keywords 3. The General Structure Of A 'C' Program 4. How To End A Statement 5. Free Format Language 6. Header Files & Library Functions
  • 6. www.swapnamithra.com 1. c'S character Set • C does not use every character set and key found on modern computers . The only characters that C language uses for its programs are as follows: A-Z all alphabets a-z all alphabets 0-9 # % & ! _ {} [] () $$$$ &&&& | space . , : ; ' $ " + - / * =
  • 7. www.swapnamithra.com the fOrm Of a c PrOgram • All C programs will consist of at least one function, but it is usual (when your experience grows) to write a C program that comprises several functions. • The only function that has to be present is the function called main. For more advanced programs the main function will act as a controlling function calling other functions in their turn to do the dirty work! The main function is the first function that is called when your program executes.
  • 8. www.swapnamithra.com the fOrm Of a c PrOgram C makes use of only 32 keywords which combine with the formal syntax to the form the C programming language. Note that all keywords are written in lower case - C, like UNIX, uses upper and lowercase text to mean different things. If you are not sure what to use then always use lowercase text in writing your C programs. A keyword may not be used for any other purposes. For example, you cannot have a variable called auto.
  • 9. www.swapnamithra.com The layouT of C Programs The general form of a C program is as follows (don't worry about what everything means at the moment - things will be explained later): pre-processor directives global declarations main() { local variables to function main ; statements associated with function main ; }
  • 10. www.swapnamithra.com f1() { local variables to function 1 ; statements associated with function 1 ; } f2() { local variables to function f2 ; statements associated with function 2 ; }
  • 11. www.swapnamithra.com  Note the use of the bracket set () and {}. () are used in conjunction with function names whereas {} are used as to delimit the C statements that are associated with that function. Also note the semicolon - yes it is there, but you might have missed it! a semicolon (;) is used to terminate C statements. C is a free format language and long statements can be continued, without truncation, onto the next line. The semicolon informs the C compiler that the end of the statement has been reached. Free format also means that you can add as many spaces as you like to improve the look of your programs.  A very common mistake made by everyone, who is new to the C programming language, is to miss off the semicolon. The C compiler will concatenate the various lines of the program together and then tries to understand them - which it will not be able to do. The error message produced by the compiler will relate to a line of you program which could be some distance from the initial mistake.
  • 12. www.swapnamithra.com PreProCessor DireCTives • C is a small language but provides the programmer with all the tools to be able to write powerful programs. Some people don't like C because it is too primitive! Look again at the set of keywords that comprises the C language and see if you can find a command that allows you to print to the computer's screen the result of, say, a simple calculation. Don't look too hard because it doesn't exist. • It would be very tedious, for all of us, if every time we wanted to communicate with the computer we all had to write our own output functions. Fortunately, we do not have to. C uses libraries of standard functions which are included when we build our programs. For the novice C programmer one of the many questions always asked is does a function already exist for what I want to do? Only experience will help here but we do include a function listing as part of this course. • All programs you will write will need to communicate to the outside world - I don't think I can think of a program that doesn't need to tell someone an answer. So all our C programs will need at least one of C's standard libraries which deals with standard inputting and outputting of data. This library is called stdin.h and it is declared in our programs before the main function. The .h extension indicates that this is a header file.
  • 13. www.swapnamithra.com • All pre-processor directives begin with a # and the must start in the first column. The commonest directive to all C programs is: #include <stdio.h> • Note the use of the angle brackets ($$$$ and &&&&) around the header's name. These indicate that the header file is to be looked for on the system disk which stores the rest of the C program application. Some text books will show the above statement as follows: • #include "stdio.h" • The double quotes indicate that the current working directory should be searched for the required header file. This will be true when you write your own header files but the standard header files should always have the angle brackets around them. • NOTE: just to keep you on your toes - pre-processor statements, such as include, DO NOT use semi-colons as delimiters! But don't forget the # must be in the first column.
  • 14. www.swapnamithra.com THANKYOU For more tutorials subscribe us . Visit www.swapnamithra.com