SlideShare a Scribd company logo
1 of 30
M VENKATESH
11604011
introduction
 C is general purpose languagewhich is very closely
associated with unix for which it was developed in bell
laboratories.
 Most of the programs UNIX are written and run with
help of c
 Many of ideas from of c stem are from BCPL, BY
Martin Richards
 In 1972 Dennis ritchie at bell laboratories wrote c
language which caused a revoultion in computing
world
About c
 C is a programmin language which can used to develop
the softwares or applications
 C can be defined as Mother language because different
programmin languages c++,python,.net.
 C can be defined as structure oriented programming
language
 C program instructions will executed line-by-line one
after the another and we need to write few statements
in specified place only
 C can be defined as procedure oriented programmin
language.
Translator
 Are the softwares which can translate the program
instruction s from one format to another
 Types of translatores :-
 1 compiler :H.L.L -> M.L(At a time all scan)
 2 Assembler :A.L ->M.l
 3 Interpreter : H.L.L->M.L(at one time line by
• line scanning)
• H.L.L means high level language
• M.L - middle level
• A.L - Assemble language
 High level language :- I is nothing but general english
language
 Middle level language:H.L.L+Assemble language
SOFTWARE
 Software:- a software is a programor a set of programs
system software:- are the software specially designed from
system
 ex: drivers-audio
 -printers
 Application software:- software are designeed from users
 Desktop application – which installation to use .
 als known as stand alone applications
 Web application – are the application runs on the server
 this is shareable
 ex :- gmail.com
History of c
 BASIC-beginners all purpose symbolic insruction code
 Cobol-commom business oriented language
 Fortran-formula transaltion
 Pascal
 Algol- algorthamic language
 Cpl-combined programming laguage
 BCPL – basic combined programming laguage
 Traditional c
 Ansic(american national standard instution)

 C95
 c99
features
 1 middle level language –h.l.l +a.l
 c programs can be written using H.L.L as well as
Assemble language
 so c is called middle level language
 Writing c programs much easier than assemble Language
 2 pre-defined language c:- c language offers pre-defined
function
 3 Modularity a program can divieded into su programs to
perform different operations.here such program called
“function”
 4 Extensibilty c programs can extend usily
 5 Memory Management:- in c language we can
allocated the memory dynamically as our requrement
so that use of memory efficient and no wastage of
memory
 6.Fast and efficient
 7.portable
C programs built from
 Variable and type declarations
 Functions
 Statements
 Expressions
a sample c program
 #include<stdio.h>
 Int man{
 Other statements
 }
Header files
 The files specified include section is called as header
file.
 These are precompiled files has some functions
defined in them
 Source file is extension .c
 Header file is extension .h
Main function
 This is entry point of program
 When file is executed the start point is main function
 From the main function the flow goes as programmers
choice
 Main function is compoulsory of any c program
Tokens type in c
 Constants:-
 Integer Constants – Refers to sequence of digits such as
decimal integer, octal integer and hexadecimal integer. –
Some of the examples are 112, 0551, 56579u, 0X2 etc.
• Real Constants – The floating point constants such as
0.0083, -0.78, +67.89 etc.
• Single Character Constants – A single char const contains a
single character enclosed within pair of single quotes [ ‘ ’ ].
For example, ‘8’, ‘a’ , ‘i’ etc.
• String Constants – A string constant is a sequence of
characters enclosed in double quotes [ “ ” ]; For example,
“0211”, “Stack Overflow” etc
Data types
 All Variables use data-type during declaration to
restrict the type of data to be stored. We can say that
data types are used to tell the variables the type of data
it can store.
 Primitive Data Types: Predefined Data Types and can
be used directly by the user to declare variables.
 Example:- int, char, float, etc.
 User defined data types:- These data types are defined
by user itself.
 Example :- Defining a Strucute in C or a union.
variables
 Variables is a name of a memory location which holds
any data
 When you create a variable in C, you must give it a data
type. You can assign a value to the variable at the time
you create it or later in your program code. This is
known as initializing the variable.
 Example:- int myVar = 0;
 Rules :-
 No space
 36-40 no lengthy characters
operators
 Operators are the foundation of any programming
language. We can define operators as symbols that helps us
to perform specific mathematical and logical computations
on operands. Types:-
 Arithmetic operators:- used to perform mathematical
operation.(+,-,*,/,%,++,--).
 Relational operators:- used for comparison of the values of
two operands.(==,>,=,<=).
 Logical operators:- used to combine two or more
conditions.(True or false)
 Bitwise operators:- used to perform bit-level operations on
the operands. And many more
statements
Output statement:-
*printf is a pre-defined function it can used to prints
message,values or result of the program
Syntax
printf(“ this is c programming”)
Input statement:-
Scanf():-
It is pre-defined function it can be used to read the values to
variables from keyoard at runtime of program
Syntax:- scanf(“format specifier list”,variable list with address
operator
If statement
 The if statements are concerned with Boolean logic. If
the statement is true, the block of code associated with
the if statement is executed. If the statement is false ,
control either falls through to the line after the if
statement, or after the closing curly brace of an if
statement block.
 Eg:- char response = ‘y’;
 if (response == ‘y’ || response == ‘Y’)
 { cout << “positive response received” << endl ;}
Switch staements
 If there are too many else if statements, code can
become messy and difficult to follow.in this scenario, a
better solution is to use a switch statement . The
switch statement simply replaces multiple else if
statements.
 Eg:- char response = ‘y’ ;
 Switch (response) { case ‘y’ : break ;
 Case ‘n’ : break ;
 Default : brea
Loops :-
 A loop is a reptative process.
 Types :-
 1.while
 Syntax:-while(condition)
 {
 satatements
 }
 2.Do-while
 syntax:- do{statements;
 }while(condition);
 3.For loop- for(intilization,condtion,inc/dec)
 Advantage:
 1.reduce length of file
 2.save time
Arrays in c
 Array is a collection of data items all of same types
 Three types of array
 1.one dimensional array
 2. two dimensional array
 3. multi dimensional array
 Array declaration syntax: data type arr_name[array_size];
 Learnt how to declare and initialize at compile time and run time
STRING IN C
 A string in C is merely an array of characters
 The length of a string is determined by a terminating null character:
'0‘
 String has some in built functions so it can save our time space and
efficient
Functions
 A Function is a block of statementswhich can useed to
perform any operation
 Pre-defined
 User defined
 Function terminology:-
 function prototype
 Function calling
 Function definition
 Parametres
 Return type
Function types
 1.no arg-no return
 2.no arg-return
 3.arg-no retun
 4.arg-retun
 Advantage
 1.extensinbility
 2.Resusebility
 3.modularity
Strucure and union
 Strucure:- collection of hetrogenous elements
 each member have memory location
 Struct is keyword
 individual members are accesed at a time
 Several members are initialised at once
 Union:
 Memory allocated individual member
 Union is keyword
 only first members are intilised
 Only one meber is accesd
pointers
 pointres:- it holds address of another varibel
 1 & address of pointer
 2. (*) value at addres pointer
 Types
 1,wild poiunter;- a pointer is not intilaised
 2dangling:-which pointer arise an object is deleted or deallocated
without modifying value of pointer.
 3.Null pointer:- initialize a pointer variable when that pointer
variable isn’t assigned any valid memory address A
 4.void pointer is a pointer that has no associated data type with
it. A void pointer can hold address of any type and can be
typcasted to a
 any type. Advantage :- malloc() calloc() is allocated at any type
DYNAMIC MEMORY ALLOCATION
 It is aprocess of allocating memory during execution time (or)
run time.
 Header file:- alloc.h or stdlib.h
 There are four types In this
 1.malloc
 2.calloc
 3.realloc
 4.free
 By malloc and calloc we can increase our memory dynamically
 By using realloc we can reallocate the memory if we want
 After the programme has completed we can free our memory by
using free statement
File handling
 It is a place on the disk we are a group of data stored
permananentlry
 Types
 Text file :-
 It is humanread file
 It is modifed
 Extension is doc
 Binary file :-
 It is not human readable file
 Extension is fof,efof
Types of file
 Sequentaial
 Random access
 File operations :-
 Read
 Opening a file
 Creating a file
 Writing a file
 Modifing a file
venkatesh.pptx

More Related Content

Similar to venkatesh.pptx

Chapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this pptChapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this ppt
ANISHYAPIT
 

Similar to venkatesh.pptx (20)

Aniket tore
Aniket toreAniket tore
Aniket tore
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
 
Introduction%20C.pptx
Introduction%20C.pptxIntroduction%20C.pptx
Introduction%20C.pptx
 
C material
C materialC material
C material
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
C language
C languageC language
C language
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Presentation c++
Presentation c++Presentation c++
Presentation c++
 
Basic Information About C language PDF
Basic Information About C language PDFBasic Information About C language PDF
Basic Information About C language PDF
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
C notes
C notesC notes
C notes
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Chapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this pptChapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this ppt
 

Recently uploaded

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Recently uploaded (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 

venkatesh.pptx

  • 2. introduction  C is general purpose languagewhich is very closely associated with unix for which it was developed in bell laboratories.  Most of the programs UNIX are written and run with help of c  Many of ideas from of c stem are from BCPL, BY Martin Richards  In 1972 Dennis ritchie at bell laboratories wrote c language which caused a revoultion in computing world
  • 3. About c  C is a programmin language which can used to develop the softwares or applications  C can be defined as Mother language because different programmin languages c++,python,.net.  C can be defined as structure oriented programming language  C program instructions will executed line-by-line one after the another and we need to write few statements in specified place only  C can be defined as procedure oriented programmin language.
  • 4. Translator  Are the softwares which can translate the program instruction s from one format to another  Types of translatores :-  1 compiler :H.L.L -> M.L(At a time all scan)  2 Assembler :A.L ->M.l  3 Interpreter : H.L.L->M.L(at one time line by • line scanning) • H.L.L means high level language • M.L - middle level • A.L - Assemble language
  • 5.  High level language :- I is nothing but general english language  Middle level language:H.L.L+Assemble language
  • 6. SOFTWARE  Software:- a software is a programor a set of programs system software:- are the software specially designed from system  ex: drivers-audio  -printers  Application software:- software are designeed from users  Desktop application – which installation to use .  als known as stand alone applications  Web application – are the application runs on the server  this is shareable  ex :- gmail.com
  • 7. History of c  BASIC-beginners all purpose symbolic insruction code  Cobol-commom business oriented language  Fortran-formula transaltion  Pascal  Algol- algorthamic language  Cpl-combined programming laguage  BCPL – basic combined programming laguage  Traditional c  Ansic(american national standard instution)   C95  c99
  • 8. features  1 middle level language –h.l.l +a.l  c programs can be written using H.L.L as well as Assemble language  so c is called middle level language  Writing c programs much easier than assemble Language  2 pre-defined language c:- c language offers pre-defined function  3 Modularity a program can divieded into su programs to perform different operations.here such program called “function”
  • 9.  4 Extensibilty c programs can extend usily  5 Memory Management:- in c language we can allocated the memory dynamically as our requrement so that use of memory efficient and no wastage of memory  6.Fast and efficient  7.portable
  • 10. C programs built from  Variable and type declarations  Functions  Statements  Expressions
  • 11. a sample c program  #include<stdio.h>  Int man{  Other statements  }
  • 12. Header files  The files specified include section is called as header file.  These are precompiled files has some functions defined in them  Source file is extension .c  Header file is extension .h
  • 13. Main function  This is entry point of program  When file is executed the start point is main function  From the main function the flow goes as programmers choice  Main function is compoulsory of any c program
  • 14. Tokens type in c  Constants:-  Integer Constants – Refers to sequence of digits such as decimal integer, octal integer and hexadecimal integer. – Some of the examples are 112, 0551, 56579u, 0X2 etc. • Real Constants – The floating point constants such as 0.0083, -0.78, +67.89 etc. • Single Character Constants – A single char const contains a single character enclosed within pair of single quotes [ ‘ ’ ]. For example, ‘8’, ‘a’ , ‘i’ etc. • String Constants – A string constant is a sequence of characters enclosed in double quotes [ “ ” ]; For example, “0211”, “Stack Overflow” etc
  • 15. Data types  All Variables use data-type during declaration to restrict the type of data to be stored. We can say that data types are used to tell the variables the type of data it can store.  Primitive Data Types: Predefined Data Types and can be used directly by the user to declare variables.  Example:- int, char, float, etc.  User defined data types:- These data types are defined by user itself.  Example :- Defining a Strucute in C or a union.
  • 16. variables  Variables is a name of a memory location which holds any data  When you create a variable in C, you must give it a data type. You can assign a value to the variable at the time you create it or later in your program code. This is known as initializing the variable.  Example:- int myVar = 0;  Rules :-  No space  36-40 no lengthy characters
  • 17. operators  Operators are the foundation of any programming language. We can define operators as symbols that helps us to perform specific mathematical and logical computations on operands. Types:-  Arithmetic operators:- used to perform mathematical operation.(+,-,*,/,%,++,--).  Relational operators:- used for comparison of the values of two operands.(==,>,=,<=).  Logical operators:- used to combine two or more conditions.(True or false)  Bitwise operators:- used to perform bit-level operations on the operands. And many more
  • 18. statements Output statement:- *printf is a pre-defined function it can used to prints message,values or result of the program Syntax printf(“ this is c programming”) Input statement:- Scanf():- It is pre-defined function it can be used to read the values to variables from keyoard at runtime of program Syntax:- scanf(“format specifier list”,variable list with address operator
  • 19. If statement  The if statements are concerned with Boolean logic. If the statement is true, the block of code associated with the if statement is executed. If the statement is false , control either falls through to the line after the if statement, or after the closing curly brace of an if statement block.  Eg:- char response = ‘y’;  if (response == ‘y’ || response == ‘Y’)  { cout << “positive response received” << endl ;}
  • 20. Switch staements  If there are too many else if statements, code can become messy and difficult to follow.in this scenario, a better solution is to use a switch statement . The switch statement simply replaces multiple else if statements.  Eg:- char response = ‘y’ ;  Switch (response) { case ‘y’ : break ;  Case ‘n’ : break ;  Default : brea
  • 21. Loops :-  A loop is a reptative process.  Types :-  1.while  Syntax:-while(condition)  {  satatements  }  2.Do-while  syntax:- do{statements;  }while(condition);  3.For loop- for(intilization,condtion,inc/dec)  Advantage:  1.reduce length of file  2.save time
  • 22. Arrays in c  Array is a collection of data items all of same types  Three types of array  1.one dimensional array  2. two dimensional array  3. multi dimensional array  Array declaration syntax: data type arr_name[array_size];  Learnt how to declare and initialize at compile time and run time STRING IN C  A string in C is merely an array of characters  The length of a string is determined by a terminating null character: '0‘  String has some in built functions so it can save our time space and efficient
  • 23. Functions  A Function is a block of statementswhich can useed to perform any operation  Pre-defined  User defined  Function terminology:-  function prototype  Function calling  Function definition  Parametres  Return type
  • 24. Function types  1.no arg-no return  2.no arg-return  3.arg-no retun  4.arg-retun  Advantage  1.extensinbility  2.Resusebility  3.modularity
  • 25. Strucure and union  Strucure:- collection of hetrogenous elements  each member have memory location  Struct is keyword  individual members are accesed at a time  Several members are initialised at once  Union:  Memory allocated individual member  Union is keyword  only first members are intilised  Only one meber is accesd
  • 26. pointers  pointres:- it holds address of another varibel  1 & address of pointer  2. (*) value at addres pointer  Types  1,wild poiunter;- a pointer is not intilaised  2dangling:-which pointer arise an object is deleted or deallocated without modifying value of pointer.  3.Null pointer:- initialize a pointer variable when that pointer variable isn’t assigned any valid memory address A  4.void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be typcasted to a  any type. Advantage :- malloc() calloc() is allocated at any type
  • 27. DYNAMIC MEMORY ALLOCATION  It is aprocess of allocating memory during execution time (or) run time.  Header file:- alloc.h or stdlib.h  There are four types In this  1.malloc  2.calloc  3.realloc  4.free  By malloc and calloc we can increase our memory dynamically  By using realloc we can reallocate the memory if we want  After the programme has completed we can free our memory by using free statement
  • 28. File handling  It is a place on the disk we are a group of data stored permananentlry  Types  Text file :-  It is humanread file  It is modifed  Extension is doc  Binary file :-  It is not human readable file  Extension is fof,efof
  • 29. Types of file  Sequentaial  Random access  File operations :-  Read  Opening a file  Creating a file  Writing a file  Modifing a file