SlideShare a Scribd company logo
G.VINOTHINI MSC.,M.PHIL.
DEPT OF INFORMATION TECHNOLOGY,
BON SECOURS COLLEGE FOR WOMEN,
THANJAVUR.
 History of c.
 Introduction to c.
 Uses of c & importance of c.
 C tokens.
 Array, string, pointers.
 Structures and unions.
year language Developed by
1960 ALGOL INTERNATIONL GROUP
1967 BCPL MARTIN RICHARDS
1970 B KEN THOMPSON
1972 C DENNIS RITCHIE
1978 K&RC KEMIGHAN &RITCHIE
1989 ANSI C ANSI COMMITTEE
1990 ANSI/ISO ISO COMMITTEE
1999 C99 STANDARDIZATION
COMMITTEE
 C is a structured programming language.
 C was originally developed in the 1972 by dennis
ritchie at bell telephone laboratories.
 C is a high level language, which is developed for
UNIX operating system.
 C is often called a middle level language because
it combines the best element of low level
language or machine level language with high
level language.
 C is used for creating computer application.
 Used in writing embedded software.
 Create compiler for different language.
 Implement different operating system.
 Very simple language.
 Highly portable.
 Middle level language.
 Only 32 keywords so easy to make.
 Very fast execution speed.
 Individual words and punctuation marks are called
tokens.
 The smallest individual units are known as tokens
C tokens
Keywords constants strings operators
Special symbolsidentifiers
float
while
100
14.5
“IJK”
“Best”
main
amount
+ -
* /
{ }
[ ]
 Every C word is classified as either a keyword or
an identifier.
 All keywords have fixed meaning and these
meaning cannot be changed.
 All keywords must be written in lowercase .
• auto
• break
• case
• char
• const
• continue
• default
• do
• double
• else
• enum
• extern
• float
• for
• goto
• if
• int
• long
• register
• return
• short
• signed
• size of
• static
• struct
• switch
• typedef
• union
• unsigned
• void
• volatile
• while
 First character must be an alphabet (or
underscore).
 Must consist of only letters , digits and
underscore.
 Only first 31 characters are significant.
 Cannot use a keyword.
 Must not contain white space.
 C refers to fixed values that do not change
during the execution of a program
constants
Numeric character
singlerealint string
decimal
octal
Hexa
decimal
exponentfractional
Constant meaning
‘ a’ Alert
‘ b’ Backspace
‘ f Form feed
‘ n’ New line
‘ r’ Carriage return
‘ t’ Horizontal tab
‘ v’ Vertical tab
‘” Single quote
`”' Double quote
‘?’ Question mark
‘’ backslash
 A variable is a data name that may be used to
store a data value.
 A variable name can be chosen by the
programmer in a meaningful way.
14 5 19
a b c
 They must begin with a letter.
 Uppercase and lowercase are significant.
 It should not be a keyword.
 White space is not allowed.
Variable name valid Remark
First -tag valid
char Not valid Char is a
keyword
Price$ Not valid Dollar sign is
illegal
Group one Not valid Blank space is
not permitted
Int_type valid Keyword may be
part of a name
 C language is rich in data types .
 A data type define as set of values and the
operation that can be performed on them.
Primary data types
Derived data types
User defined data types
D
A
T
A
T
Y
P
E
S
 Data types represent types of input to be carried
in variable.
9 3.5 ‘d’
Integer(number)
Float
(number) character
primary Data type
character integer float void
char signed unsigned float
signed int int double
un signed short int short int long
double long int long int
type Size(bits) range
Char or unsigned
char
8 -128to 127
Unsigned char 8 0 to 255
Int or signed int 16 -32,768 to 32,767
Unsigned int 16 0 to 65535
Short int or signed
short int
8 -128 to 127
Unsigned short int 8 O to 255
Long int or signed
long int
32 -2,147,483,648 to
2,147,483,647
Unsigned long int 32 0 to 4,294,967,295
Float 32 3.4E-38 to
3.4E+38
Double 64 1.7E-308 to
1.7E+308
Stdio.h Standard i/o header file
Conio.h Console i/o header file
String.h Collection of character make string
Math.h Used to mathematic function
Graphic.h Used to draw any shape
Dos.h Delay output
 get char():
get char() function is used to get
/read a character from keyboard.
getchar(char);
 Put char();
put char () to output the values of
character variable.
putchar(char);
 Printf() function is used to print the “character
string ,float , integer , octal and hexadecimal
values” on to the output screen.
 Printf() function with %d format specifier to
display the value of integer variable.
 Scanf() function is used to read character,
string, numeric data from a keyboard.
 An array is a fixed size sequenced collection of
elements of the same data type.
 An array is a group of related data items that
shared a common name.
ARRAYS
ONE
DIMENSIONAL
ARRAYS
TWO
DIMENSIONAL
ARRAYS
MULTIDIMENSION
AL ARRAYS
 A pointer is derived data type in c
 Pointers contain memory addresses as their
values.
 Pointers are more efficient in handling arrays
and data tables.
 Pointers can be used to return multiple values
from a function via function arguments.
 Pointers allow c to support dynamic memory
management.
 Pointers reduce length and complexity of
programs.
 They increase the execution speed and thus
reduce the program execution time.
 A String is a sequence of character that is
treated as a single data items.
 Any group of characters(except double quote
sign)define between double quotation marks
is a string constant.
 Character strings are often used to build
meaningful and readable function.
char string-name[size]
 C library supports a large number of string
handling function .
Function action
Strcat() Concatenates two string
Strcmp() Compare two strings
Strcpy() Copies one string over
another
Strlen() Finds the length of a string
 A structure in C is a collection of items of different
types.
 A structure creates a data type that can be used to
group items of possibility different types into a single
type.
 ‘struct’ keyword is used to create a structure.
struct address
{
Char name[50];
Char street[100];
Char city[50];
Int pin;
}
 A union is a special data type .
 C allows to store different data types in the
same memory location.
 Define a union with many members ,but only
one member can contain a value at any given
time.
 Union provide an efficient way of using the
same memory location for multiple –purpose.
THANK YOU….

More Related Content

What's hot

Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 

What's hot (20)

Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
C data type format specifier
C data type format specifierC data type format specifier
C data type format specifier
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
 
Numeric Data Types & Strings
Numeric Data Types & StringsNumeric Data Types & Strings
Numeric Data Types & Strings
 
Character set of c
Character set of cCharacter set of c
Character set of c
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
basics of c++
basics of c++basics of c++
basics of c++
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
C language
C languageC language
C language
 
Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)Lecture02(constants, variable & data types)
Lecture02(constants, variable & data types)
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
Data types
Data typesData types
Data types
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
C language basics
C language basicsC language basics
C language basics
 
Mesics lecture 3 c – constants and variables
Mesics lecture 3   c – constants and variablesMesics lecture 3   c – constants and variables
Mesics lecture 3 c – constants and variables
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 

Similar to Programming in c

434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
MAHESHV559910
 

Similar to Programming in c (20)

C presentation book
C presentation bookC presentation book
C presentation book
 
All C ppt.ppt
All C ppt.pptAll C ppt.ppt
All C ppt.ppt
 
C tutorial
C tutorialC tutorial
C tutorial
 
C notes
C notesC notes
C notes
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Theory1&2
Theory1&2Theory1&2
Theory1&2
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
Cnotes
CnotesCnotes
Cnotes
 
Chap 1 and 2
Chap 1 and 2Chap 1 and 2
Chap 1 and 2
 
Introduction to C
Introduction to CIntroduction to C
Introduction to C
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
 
C
CC
C
 
C programming language
C programming languageC programming language
C programming language
 
Features and Fundamentals of C Language for Beginners
Features and Fundamentals of C Language for BeginnersFeatures and Fundamentals of C Language for Beginners
Features and Fundamentals of C Language for Beginners
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
 

More from vinothinisureshbabu (11)

SYNCHRONIZATION
SYNCHRONIZATIONSYNCHRONIZATION
SYNCHRONIZATION
 
Adobe page maker
Adobe page makerAdobe page maker
Adobe page maker
 
Operating systems
Operating systems Operating systems
Operating systems
 
Sequenential circuit-dcf
Sequenential circuit-dcfSequenential circuit-dcf
Sequenential circuit-dcf
 
DCF-Combinational circuit
DCF-Combinational circuitDCF-Combinational circuit
DCF-Combinational circuit
 
DCF - K map
DCF - K mapDCF - K map
DCF - K map
 
DCF- Logic gates and circuit
DCF- Logic gates and circuitDCF- Logic gates and circuit
DCF- Logic gates and circuit
 
Digital computer fundamentals
Digital computer fundamentalsDigital computer fundamentals
Digital computer fundamentals
 
Os - device management
Os - device managementOs - device management
Os - device management
 
Introduction to ms access
Introduction to ms accessIntroduction to ms access
Introduction to ms access
 
computer organization and architecture
computer organization and architecturecomputer organization and architecture
computer organization and architecture
 

Recently uploaded

Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
YibeltalNibretu
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 

Recently uploaded (20)

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Accounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdfAccounting and finance exit exam 2016 E.C.pdf
Accounting and finance exit exam 2016 E.C.pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 

Programming in c

  • 1. G.VINOTHINI MSC.,M.PHIL. DEPT OF INFORMATION TECHNOLOGY, BON SECOURS COLLEGE FOR WOMEN, THANJAVUR.
  • 2.  History of c.  Introduction to c.  Uses of c & importance of c.  C tokens.  Array, string, pointers.  Structures and unions.
  • 3. year language Developed by 1960 ALGOL INTERNATIONL GROUP 1967 BCPL MARTIN RICHARDS 1970 B KEN THOMPSON 1972 C DENNIS RITCHIE 1978 K&RC KEMIGHAN &RITCHIE 1989 ANSI C ANSI COMMITTEE 1990 ANSI/ISO ISO COMMITTEE 1999 C99 STANDARDIZATION COMMITTEE
  • 4.  C is a structured programming language.  C was originally developed in the 1972 by dennis ritchie at bell telephone laboratories.  C is a high level language, which is developed for UNIX operating system.  C is often called a middle level language because it combines the best element of low level language or machine level language with high level language.
  • 5.  C is used for creating computer application.  Used in writing embedded software.  Create compiler for different language.  Implement different operating system.
  • 6.  Very simple language.  Highly portable.  Middle level language.  Only 32 keywords so easy to make.  Very fast execution speed.
  • 7.  Individual words and punctuation marks are called tokens.  The smallest individual units are known as tokens C tokens Keywords constants strings operators Special symbolsidentifiers float while 100 14.5 “IJK” “Best” main amount + - * / { } [ ]
  • 8.  Every C word is classified as either a keyword or an identifier.  All keywords have fixed meaning and these meaning cannot be changed.  All keywords must be written in lowercase . • auto • break • case • char • const • continue • default • do • double • else • enum • extern • float • for • goto • if • int • long • register • return • short • signed • size of • static • struct • switch • typedef • union • unsigned • void • volatile • while
  • 9.  First character must be an alphabet (or underscore).  Must consist of only letters , digits and underscore.  Only first 31 characters are significant.  Cannot use a keyword.  Must not contain white space.
  • 10.  C refers to fixed values that do not change during the execution of a program constants Numeric character singlerealint string decimal octal Hexa decimal exponentfractional
  • 11. Constant meaning ‘ a’ Alert ‘ b’ Backspace ‘ f Form feed ‘ n’ New line ‘ r’ Carriage return ‘ t’ Horizontal tab ‘ v’ Vertical tab ‘” Single quote `”' Double quote ‘?’ Question mark ‘’ backslash
  • 12.  A variable is a data name that may be used to store a data value.  A variable name can be chosen by the programmer in a meaningful way. 14 5 19 a b c
  • 13.  They must begin with a letter.  Uppercase and lowercase are significant.  It should not be a keyword.  White space is not allowed. Variable name valid Remark First -tag valid char Not valid Char is a keyword Price$ Not valid Dollar sign is illegal Group one Not valid Blank space is not permitted Int_type valid Keyword may be part of a name
  • 14.  C language is rich in data types .  A data type define as set of values and the operation that can be performed on them. Primary data types Derived data types User defined data types D A T A T Y P E S
  • 15.  Data types represent types of input to be carried in variable. 9 3.5 ‘d’ Integer(number) Float (number) character
  • 16. primary Data type character integer float void char signed unsigned float signed int int double un signed short int short int long double long int long int
  • 17. type Size(bits) range Char or unsigned char 8 -128to 127 Unsigned char 8 0 to 255 Int or signed int 16 -32,768 to 32,767 Unsigned int 16 0 to 65535 Short int or signed short int 8 -128 to 127 Unsigned short int 8 O to 255 Long int or signed long int 32 -2,147,483,648 to 2,147,483,647 Unsigned long int 32 0 to 4,294,967,295 Float 32 3.4E-38 to 3.4E+38 Double 64 1.7E-308 to 1.7E+308
  • 18. Stdio.h Standard i/o header file Conio.h Console i/o header file String.h Collection of character make string Math.h Used to mathematic function Graphic.h Used to draw any shape Dos.h Delay output
  • 19.  get char(): get char() function is used to get /read a character from keyboard. getchar(char);  Put char(); put char () to output the values of character variable. putchar(char);
  • 20.  Printf() function is used to print the “character string ,float , integer , octal and hexadecimal values” on to the output screen.  Printf() function with %d format specifier to display the value of integer variable.  Scanf() function is used to read character, string, numeric data from a keyboard.
  • 21.  An array is a fixed size sequenced collection of elements of the same data type.  An array is a group of related data items that shared a common name. ARRAYS ONE DIMENSIONAL ARRAYS TWO DIMENSIONAL ARRAYS MULTIDIMENSION AL ARRAYS
  • 22.  A pointer is derived data type in c  Pointers contain memory addresses as their values.  Pointers are more efficient in handling arrays and data tables.  Pointers can be used to return multiple values from a function via function arguments.  Pointers allow c to support dynamic memory management.  Pointers reduce length and complexity of programs.  They increase the execution speed and thus reduce the program execution time.
  • 23.  A String is a sequence of character that is treated as a single data items.  Any group of characters(except double quote sign)define between double quotation marks is a string constant.  Character strings are often used to build meaningful and readable function. char string-name[size]
  • 24.  C library supports a large number of string handling function . Function action Strcat() Concatenates two string Strcmp() Compare two strings Strcpy() Copies one string over another Strlen() Finds the length of a string
  • 25.  A structure in C is a collection of items of different types.  A structure creates a data type that can be used to group items of possibility different types into a single type.  ‘struct’ keyword is used to create a structure. struct address { Char name[50]; Char street[100]; Char city[50]; Int pin; }
  • 26.  A union is a special data type .  C allows to store different data types in the same memory location.  Define a union with many members ,but only one member can contain a value at any given time.  Union provide an efficient way of using the same memory location for multiple –purpose.