SlideShare a Scribd company logo
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 Programme
SAFAD ISMAIL
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, Strings
Prabu 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 C
Prabu 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 languages
LiemLe21
 
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
Mansi Tyagi
 
Features of 'c' program
Features of 'c' programFeatures of 'c' program
Features of 'c' program
veer patel
 
Programming languages
Programming languagesProgramming languages
Programming languages
Râhûl Røy
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is Dead
Sigasi
 
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 orientation
nikshaikh786
 
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 point
Mitali Chugh
 
C programming
C programmingC programming
C programming
Jigarthacker
 
C programming tutorial for beginners
C programming tutorial for beginnersC programming tutorial for beginners
C programming tutorial for beginners
Thiyagarajan Soundhiran
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
JEENA 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 Olusegun
Engr. Adefami Segun, MNSE
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
CHAPTER 3
CHAPTER 3CHAPTER 3
CHAPTER 3
mohd_mizan
 
Software code metrics
Software code metricsSoftware code metrics
Software code metrics
PVS-Studio
 
Input output in c
Input output in cInput output in c
Input output in c
Ducat
 

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 order
Malikireddy Bramhananda Reddy
 
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
Malikireddy Bramhananda Reddy
 
CHAPTER 1
CHAPTER 1CHAPTER 1
CHAPTER 1
mohd_mizan
 
CS3251-_PIC
CS3251-_PICCS3251-_PIC
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
Kuntal Bhowmick
 
Programming in c
Programming in cProgramming in c
Programming in c
ankitjain851
 
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
Rajeshkumar Reddy
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
BAKRANIYA KALPESH
 
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
Rai 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 language
Rai 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 language
Rai University
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
Rai 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 language
Rai University
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
Subramanyambharathis
 
C PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdfC PROGRAMMING p-2.pdf
C PROGRAMMING p-2.pdf
D.K.M college for women
 
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
SanketShah544615
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
Sowmya Jyothi
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++
Seble Nigussie
 
C session 1.pptx
C session 1.pptxC session 1.pptx
C session 1.pptx
NIRMALRAJSCSE20
 
Book ppt
Book pptBook ppt
Book ppt
FALLEE31188
 

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

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 

Recently uploaded (20)

AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 

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.