SlideShare a Scribd company logo
1 of 19
Session 1
Basics of ‘C’
Programming in C / Session 1 / 2 of 19
Objectives
 Explain the beginning of C
 Explain why and when C is used
 Discuss the C program structure
 Discuss algorithms
 Demonstrate use of flowcharts
 Apply the rules for writing C program
 Demonstrate compilation and execution of a C program
Programming in C / Session 1 / 3 of 19
Problem Solving Approach
A step-by-step approach is used to solve any
problem
The step-by-step approach that is applied to
solve a problem may vary according to the
situation
The commonly used approaches are
Programs
Flow Charts
Algorithms
Programming in C / Session 1 / 4 of 19
Programs 2-1
Instructions grouped together in a sequential
manner is called a program.
Program helps perform a task or solve a
problem.
A program ensures that the task takes place
without any obstructions.
When the set of instructions are known, the
execution of the program takes place smoothly.
Programming in C / Session 1 / 5 of 19
Programs 2-2
 Here, the boss gives simple instructions in a sequential
manner to perform a task without interruptions.
Programming in C / Session 1 / 6 of 19
Flow Charts 3-1
Pictorial representation of the approach to
solving a problem, with use of standard set of
symbols, is a Flow Chart.
As a picture speaks better than words, drawing a
diagram will help the user understand the
solution easily.
The Flow chart can also help the user to
understand the correct flow of actions and steps
to follow.
Programming in C / Session 1 / 7 of 19
Flow Charts 3-2
Flow charts use a standard set of symbols.
Rectangles for processing
Diamond shapes for decision making
The symbols are accepted and understood
uniformly by all the programmers in the world.
Connectors are used to link flow charts that are
in multiple pages.
Any flow chart always has a START and STOP.
Programming in C / Session 1 / 8 of 19
Flow Charts 3-3
START
Result =
num1 * num2
Display
Result
STOP
Accept num1
and num 2
Terminator Symbol: Used
here to begin the Flow chart
Input / Output Symbol: Used
here to accept numbers
Process Symbol: Used here to
multiply two numbers and
obtain the result
Input / Output Symbol: Used
here to display the result
Terminator Symbol: Used
here to end the Flow chart
Programming in C / Session 1 / 9 of 19
Algorithms
Formulation of an approach to solve a problem
in simple and understandable language is called
an algorithm.
Statements in algorithms clearly explain the
action that is to be performed by that step.
The steps have to be short and precise.
Collection of these steps, helps solve the
problem.
Two different individuals can write two different
algorithms to achieve the same result.
Algorithm to calculate the area of a rectangle
1. Accept two values from the user as the length and
breadth of the rectangle.
2. Multiply the length and breadth to obtain the area.
3. Display the area.
Programming in C / Session 1 / 10 of 19
History of C 2-1
Languages like B, Combined Programming
Language (CPL) and Basic CPL were used
popularly.
The B language used earlier was added with
basic functionality of BCPL to create C language.
Dennis Ritchie developed C in 1972 while
working with Bell Laboratories.
C was developed on PDP – 11 computers.
Programming in C / Session 1 / 11 of 19
History of C 2-2
UNIX operating system was re-written using the
C language.
When UNIX was re-written, only a part of the
original assembly language was retained.
Most universities used UNIX and this helped
make C a popular language among students.
To avoid compatibility problems arising from the
variations of C language developed by different
companies, ANSI set the guidelines for
standardising C. This is called ANSI C.
Programming in C / Session 1 / 12 of 19
Applications of C
 The most popular example of C application is the re -
creation of UNIX operating system.
 C is used to develop compilers, interpreters, graphic and
general utilities.
 C has been used in the development of various
databases, word processors and spread sheets.
 Power and flexibility has prompted the use of C
language in the development of custom – made
applications like railway ticket vending machines and
applications in the banking and insurance sector.
Programming in C / Session 1 / 13 of 19
Structure of C program 2-1
A typical C program is as follows
#include<stdio.h>
main()
{
printf("Hello Worldn");
}
Pre-processor
command
Starting point of the program
Opening brace
Prints Hello World
Closing brace
Programming in C / Session 1 / 14 of 19
Structure of C program 2–2
 Output of the program is
Programming in C / Session 1 / 15 of 19
Compiling 2-1
 There are four files associated when a C program is
compiled
 Source code – with ‘.c’ as the extension. It is the file
where the program instructions are written.
 Header File – contains the declaration of functions and
the pre-processor commands. It has ‘.h’ as its extension.
 Object Files – these are the files created by the compiler
and have a extension either as ‘.o’ or ‘.obj’.
 Binary Executables – output from the linking process.
The extension of these files is ‘.exe’.
 The linker is a program that collects all the related object
files and creates an executable file.
Programming in C / Session 1 / 16 of 19
Compiling 2-2
Source Code (User
written program)
Compile the Source Code
Object File created.
But not executed
Executable File for
execution
Link the object files to
create an executable file
Programming in C / Session 1 / 17 of 19
Project in Visual C++
Creating a new file and saving it in the proper
directory.
Writing the C program in the IDE.
Building the project.
Executing the project.
Closing the project.
Demonstration
The steps involved in creating a project in Visual C++
Programming in C / Session 1 / 18 of 19
Summary 2-1
Algorithms help achieve a task with the help of
well-defined statements.
Algorithms can be pictorial or graphically
presented by flow charts.
For easy understanding of the depicted flow
charts, a standards set of symbols is used
across the industry.
Sequentially grouped set of instructions for
performing a task is called a Program.
Programming in C / Session 1 / 19 of 19
Summary 2-2
C language is extremely powerful and flexible as
it exhibits the features of both second and third
generation languages.
Compiler converts a program into a program
understood by the machine.
Linker is a program that links related object files
to create an executable program.

More Related Content

What's hot

IP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeIP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeSAFAD ISMAIL
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsPrabu U
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CPrabu U
 
ch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesLiemLe21
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEMMansi Tyagi
 
Features of 'c' program
Features of 'c' programFeatures of 'c' program
Features of 'c' programveer patel
 
Programming languages
Programming languagesProgramming languages
Programming languagesRâhûl Røy
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is DeadSigasi
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Nuzhat Memon
 
C programming orientation
C programming orientationC programming orientation
C programming orientationnikshaikh786
 
Introduction to Programming using C/C++
Introduction to Programming using C/C++Introduction to Programming using C/C++
Introduction to Programming using C/C++Dr Piyush Charan
 
Loc and function point
Loc and function pointLoc and function point
Loc and function pointMitali Chugh
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGJEENA SARA VIJU
 
Refinery Blending Problems by Engr. Adefami Olusegun
Refinery Blending Problems by Engr. Adefami OlusegunRefinery Blending Problems by Engr. Adefami Olusegun
Refinery Blending Problems by Engr. Adefami OlusegunEngr. Adefami Segun, MNSE
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Software code metrics
Software code metricsSoftware code metrics
Software code metricsPVS-Studio
 
Input output in c
Input output in cInput output in c
Input output in cDucat
 

What's hot (20)

IP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG ProgrammeIP Lab Manual for Kerala University 3 Year UG Programme
IP Lab Manual for Kerala University 3 Year UG Programme
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, Strings
 
Problem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to CProblem Solving Techniques and Introduction to C
Problem Solving Techniques and Introduction to C
 
ch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesch01_an overview of computers and programming languages
ch01_an overview of computers and programming languages
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
 
Features of 'c' program
Features of 'c' programFeatures of 'c' program
Features of 'c' program
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is Dead
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)
 
C programming orientation
C programming orientationC programming orientation
C programming orientation
 
Introduction to Programming using C/C++
Introduction to Programming using C/C++Introduction to Programming using C/C++
Introduction to Programming using C/C++
 
Loc and function point
Loc and function pointLoc and function point
Loc and function point
 
C programming
C programmingC programming
C programming
 
C programming tutorial for beginners
C programming tutorial for beginnersC programming tutorial for beginners
C programming tutorial for beginners
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
Refinery Blending Problems by Engr. Adefami Olusegun
Refinery Blending Problems by Engr. Adefami OlusegunRefinery Blending Problems by Engr. Adefami Olusegun
Refinery Blending Problems by Engr. Adefami Olusegun
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
CHAPTER 3
CHAPTER 3CHAPTER 3
CHAPTER 3
 
Software code metrics
Software code metricsSoftware code metrics
Software code metrics
 
Input output in c
Input output in cInput output in c
Input output in c
 

Similar to Session1 c1

C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit orderMalikireddy Bramhananda Reddy
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYRajeshkumar Reddy
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c languageRai University
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageRai University
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageRai University
 
introduction to c language
 introduction to c language introduction to c language
introduction to c languageRai University
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageRai University
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxSanketShah544615
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiSowmya Jyothi
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++Seble Nigussie
 

Similar to Session1 c1 (20)

C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
CHAPTER 1
CHAPTER 1CHAPTER 1
CHAPTER 1
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
CS3251-_PIC
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
C PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdfC PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdf
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptx
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++
 
C session 1.pptx
C session 1.pptxC session 1.pptx
C session 1.pptx
 
Book ppt
Book pptBook ppt
Book ppt
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 

Session1 c1

  • 2. Programming in C / Session 1 / 2 of 19 Objectives  Explain the beginning of C  Explain why and when C is used  Discuss the C program structure  Discuss algorithms  Demonstrate use of flowcharts  Apply the rules for writing C program  Demonstrate compilation and execution of a C program
  • 3. Programming in C / Session 1 / 3 of 19 Problem Solving Approach A step-by-step approach is used to solve any problem The step-by-step approach that is applied to solve a problem may vary according to the situation The commonly used approaches are Programs Flow Charts Algorithms
  • 4. Programming in C / Session 1 / 4 of 19 Programs 2-1 Instructions grouped together in a sequential manner is called a program. Program helps perform a task or solve a problem. A program ensures that the task takes place without any obstructions. When the set of instructions are known, the execution of the program takes place smoothly.
  • 5. Programming in C / Session 1 / 5 of 19 Programs 2-2  Here, the boss gives simple instructions in a sequential manner to perform a task without interruptions.
  • 6. Programming in C / Session 1 / 6 of 19 Flow Charts 3-1 Pictorial representation of the approach to solving a problem, with use of standard set of symbols, is a Flow Chart. As a picture speaks better than words, drawing a diagram will help the user understand the solution easily. The Flow chart can also help the user to understand the correct flow of actions and steps to follow.
  • 7. Programming in C / Session 1 / 7 of 19 Flow Charts 3-2 Flow charts use a standard set of symbols. Rectangles for processing Diamond shapes for decision making The symbols are accepted and understood uniformly by all the programmers in the world. Connectors are used to link flow charts that are in multiple pages. Any flow chart always has a START and STOP.
  • 8. Programming in C / Session 1 / 8 of 19 Flow Charts 3-3 START Result = num1 * num2 Display Result STOP Accept num1 and num 2 Terminator Symbol: Used here to begin the Flow chart Input / Output Symbol: Used here to accept numbers Process Symbol: Used here to multiply two numbers and obtain the result Input / Output Symbol: Used here to display the result Terminator Symbol: Used here to end the Flow chart
  • 9. Programming in C / Session 1 / 9 of 19 Algorithms Formulation of an approach to solve a problem in simple and understandable language is called an algorithm. Statements in algorithms clearly explain the action that is to be performed by that step. The steps have to be short and precise. Collection of these steps, helps solve the problem. Two different individuals can write two different algorithms to achieve the same result. Algorithm to calculate the area of a rectangle 1. Accept two values from the user as the length and breadth of the rectangle. 2. Multiply the length and breadth to obtain the area. 3. Display the area.
  • 10. Programming in C / Session 1 / 10 of 19 History of C 2-1 Languages like B, Combined Programming Language (CPL) and Basic CPL were used popularly. The B language used earlier was added with basic functionality of BCPL to create C language. Dennis Ritchie developed C in 1972 while working with Bell Laboratories. C was developed on PDP – 11 computers.
  • 11. Programming in C / Session 1 / 11 of 19 History of C 2-2 UNIX operating system was re-written using the C language. When UNIX was re-written, only a part of the original assembly language was retained. Most universities used UNIX and this helped make C a popular language among students. To avoid compatibility problems arising from the variations of C language developed by different companies, ANSI set the guidelines for standardising C. This is called ANSI C.
  • 12. Programming in C / Session 1 / 12 of 19 Applications of C  The most popular example of C application is the re - creation of UNIX operating system.  C is used to develop compilers, interpreters, graphic and general utilities.  C has been used in the development of various databases, word processors and spread sheets.  Power and flexibility has prompted the use of C language in the development of custom – made applications like railway ticket vending machines and applications in the banking and insurance sector.
  • 13. Programming in C / Session 1 / 13 of 19 Structure of C program 2-1 A typical C program is as follows #include<stdio.h> main() { printf("Hello Worldn"); } Pre-processor command Starting point of the program Opening brace Prints Hello World Closing brace
  • 14. Programming in C / Session 1 / 14 of 19 Structure of C program 2–2  Output of the program is
  • 15. Programming in C / Session 1 / 15 of 19 Compiling 2-1  There are four files associated when a C program is compiled  Source code – with ‘.c’ as the extension. It is the file where the program instructions are written.  Header File – contains the declaration of functions and the pre-processor commands. It has ‘.h’ as its extension.  Object Files – these are the files created by the compiler and have a extension either as ‘.o’ or ‘.obj’.  Binary Executables – output from the linking process. The extension of these files is ‘.exe’.  The linker is a program that collects all the related object files and creates an executable file.
  • 16. Programming in C / Session 1 / 16 of 19 Compiling 2-2 Source Code (User written program) Compile the Source Code Object File created. But not executed Executable File for execution Link the object files to create an executable file
  • 17. Programming in C / Session 1 / 17 of 19 Project in Visual C++ Creating a new file and saving it in the proper directory. Writing the C program in the IDE. Building the project. Executing the project. Closing the project. Demonstration The steps involved in creating a project in Visual C++
  • 18. Programming in C / Session 1 / 18 of 19 Summary 2-1 Algorithms help achieve a task with the help of well-defined statements. Algorithms can be pictorial or graphically presented by flow charts. For easy understanding of the depicted flow charts, a standards set of symbols is used across the industry. Sequentially grouped set of instructions for performing a task is called a Program.
  • 19. Programming in C / Session 1 / 19 of 19 Summary 2-2 C language is extremely powerful and flexible as it exhibits the features of both second and third generation languages. Compiler converts a program into a program understood by the machine. Linker is a program that links related object files to create an executable program.