SlideShare a Scribd company logo
Fundamentals of Programming and Problem Solving
SUBJECT
The C Language
Assignment #1
Name:
Justine dela Serna
Course/ Year:
BSIT-I
The History of the C Language
The C programming language was devised in the early 1970s by Dennis M. Ritchie an employee from Bell Labs
(AT&T).
In the 1960s Ritchie worked, with several other employees of Bell Labs (AT&T), on a project called Multics. The goal
of the project was to develop an operating system for a large computer that could be used by a thousand users. In
1969 AT&T (Bell Labs) withdrew from the project, because the project could not produce an economically useful
system. So the employees of Bell Labs (AT&T) had to search for another project to work on (mainly Dennis M. Ritchie
and Ken Thompson).
Ken Thompson began to work on the development of a new file system. He wrote, a version of the new file system
for the DEC PDP-7, in assembler. (The new file system was also used for the game Space Travel). Soon they began to
make improvements and add expansions. (They used their knowledge from the Multics project to add
improvements). After a while a complete system was born. Brian W. Kernighan called the system UNIX, a sarcastic
reference to Multics. The whole system was still written in assembly code. Besides assembler and Fortran, UNIX also
had an interpreter for the programming language B. (The B language is derived directly from Martin Richards BCPL).
The language B was developed in 1969-70 by Ken Thompson. In the early days computer code was written in
assembly code. To perform a specific task, you had to write many pages of code. A high-level language like B made it
possible to write the same task in just a few lines of code. The language B was used for further development of the
UNIX system. Because of the high-level of the B language, code could be produced much faster, then in assembly.
A drawback of the B language was that it did not know data-types. (Everything was expressed in machine words).
Another functionality that the B language did not provide was the use of “structures”. The lag of these things formed
the reason for Dennis M. Ritchie to develop the programming language C. So in 1971-73 Dennis M. Ritchie turned
the B language into the C language, keeping most of the language B syntax while adding data-types and many other
changes. The C language had a powerful mix of high-level functionality and the detailed features required to
program an operating system. Therefore many of the UNIX components were eventually rewritten in C (the Unix
kernel itself was rewritten in 1973 on a DEC PDP-11).
The programming language C was written down, by Kernighan and Ritchie, in a now classic book called “The C
Programming Language, 1st
edition”. (Kernighan has said that he had no part in the design of the C language: “It’s
entirely Dennis Ritchie’s work”. But he is the author of the famous “Hello, World” program and many other UNIX
programs).
For years the book “The C Programming Language, 1st
edition” was the standard on the language C. In 1983 a
committee was formed by the American National Standards Institute (ANSI) to develop a modern definition for the
programming language C (ANSI X3J11). In 1988 they delivered the final standard definition ANSI C. (The standard
was based on the book from K&R 1st
Ed.).
The standard ANSI C made little changes on the original design of the C language. (They had to make sure that old
programs still worked with the new standard). Later on, the ANSI C standard was adopted by the International
Standards Organization (ISO). The correct term should therefore be ISO C, but everybody still calls it ANSI C.
Environment of C Language
Like most imperative languages in the ALGOL tradition, C has facilities for structured programming
and allows lexical variable scope and recursion, while a static type system prevents many unintended
operations. In C, all executable code is contained within subroutines, which are called "functions"
(although not in the strict sense of functional programming). Function parameters are always passed by
value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is
free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of
statements.
C is often used for "system programming", including implementing operating systems and
embedded system applications, due to a combination of desirable characteristics such as code portability
and efficiency, ability to access specific hardware addresses, ability to pun types to match externally
imposed data access requirements, and low run-time demand on system resources. C can also be used for
website programming using CGI as a "gateway" for information between the Web application, the server,
and the browser.[29]
Some reasons for choosing C over interpreted languages are its speed, stability, and
near-universal availability.
One consequence of C's wide availability and efficiency is that compilers, libraries, and
interpreters of other programming languages are often implemented in C.
The primary implementations of Python (CPython), Perl 5, and PHP are all written in C.
Due to its thin layer of abstraction and low overhead, C allows efficient implementations of
algorithms and data structures, which is useful for programs that perform a lot of computations. For
example, the GNU Multi-Precision Library, the GNU Scientific Library, Mathematica and MATLAB are
completely or partially written in C.
C is sometimes used as an intermediate language by implementations of other languages. This
approach may be used for portability or convenience; by using C as an intermediate language, it is not
necessary to develop machine-specific code generators. C has some features, such as line-number
preprocessor directives and optional superfluous commas at the end of initializer lists, which support
compilation of generated code. However, some of C's shortcomings have prompted the development of
other C-based languages specifically designed for use as intermediate languages, such as C--.
C has also been widely used to implement end-user applications, but much of that development
has shifted to newer languages.
 Elements of C :
C Tokens:
Keyword
Identifier
Constant
String-literal
Operator
Punctuator
C Constants:
floating-point
integer
enumeration
character
C Keywords:
auto
break
case
default
else
float
goto
int
long
register
sizeof
typedef
unsigned
volatile
while
C Identifiers:
float _number;
float a;
int ;
The following are illegal (it's your job to recognize why):
float :e;
float for;
float 9PI;
float .3.14;
float 7g;
C String Literals:
(any member of the source character set except the double quotation mark ("), backslash (), or newline character)
" s-char-sequence opt "
L" s-char-sequence opt "
s-char-sequence:
The example below is a simple string literal:
char *amessage = "This is a string literal.";
Punctuation and Special Characters:
[ ] ( ) { } * , : = ; ... #
The pound sign (#) can occur only in preprocessing directives.
CONSTANT
In computer programming, a constant is an identifier whose associated value cannot typically be altered by the
program during its execution (though in some cases this can be circumvented, e.g. using self-modifying code). Many
programming languages make an explicit syntactic distinction between constant and variable symbols.
Although a constant's value is specified only once, a constant may be referenced many times in a program. Using a
constant instead of specifying a value multiple times in the program can not only simplify code maintenance, but it
can also supply a meaningful name for it and consolidate such constant bindings to a standard code location (for
example, at the beginning).
VARIABLE
In computer programming, a variable is a storage location and an associated symbolic name (an identifier) which
contains some known or unknown quantity or information, a value. The variable name is the usual way to reference
the stored value; this separation of name and content allows the name to be used independently of the exact
information it represents. The identifier in computer source code can be bound to a value during run time, and the
value of the variable may thus change during the course of program execution. Variables in programming may not
directly correspond to the concept of variables in mathematics. The value of a computing variable is not necessarily
part of an equation or formula as in mathematics. In computing, a variable may be employed in a repetitive process:
assigned a value in one place, then used elsewhere, then reassigned a new value and used again in the same way
(see iteration). Variables in computer programming are frequently given long names to make them relatively
descriptive of their use, whereas variables in mathematics often have terse, one- or two-character names for brevity
in transcription and manipulation.
A variable storage location may be referred by several different identifiers, a situation known as aliasing. Assigning a
value to the variable using one of the identifiers will change the value that can be accessed through the other
identifiers.
Compilers have to replace variables' symbolic names with the actual locations of the data. While a variable's name,
type, and location often remain fixed, the data stored in the location may be changed during program execution.
DATATYPE
In computer science and computer programming, a data type or simply type is a classification identifying one of
various types of data, such as real-valued, integer or Boolean, that determines the possible values for that type; the
operations that can be done on values of that type; the meaning of the data; and the way values of that type can be
stored.Data types are used within type systems, which offer various ways of defining, implementing and using them.
Different type systems ensure varying degrees of type safety. Formally, a type can be defined as "any property of a
programme we can determine without executing the program".
Almost all programming languages explicitly include the notion of data type, though different languages may use
different terminology.
Justine dela Serna
BSIT-I

More Related Content

What's hot

Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Computer architecture mcq (2)
Computer architecture mcq (2)Computer architecture mcq (2)
Computer architecture mcq (2)
Nazir Ahmed
 
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
Ejiro Ndifereke
 
Scripting and automation with the Men & Mice Suite
Scripting and automation with the Men & Mice SuiteScripting and automation with the Men & Mice Suite
Scripting and automation with the Men & Mice Suite
Men and Mice
 
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
Ejiro Ndifereke
 
computer fundamental mcq 300 questions
computer fundamental mcq 300 questionscomputer fundamental mcq 300 questions
computer fundamental mcq 300 questions
Rai Saheb Bhanwar Singh College Nasrullaganj
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
Gary Bisson
 
Graphics Processing Unit - GPU
Graphics Processing Unit - GPUGraphics Processing Unit - GPU
Graphics Processing Unit - GPU
Chetan Gole
 
Introduction to programming concepts
Introduction to programming conceptsIntroduction to programming concepts
Introduction to programming concepts
hermiraguilar
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Tushar B Kute
 
Elements of programming
Elements of programmingElements of programming
JS2 Computer Studies Examination (Third Term)
JS2 Computer Studies Examination (Third Term)JS2 Computer Studies Examination (Third Term)
JS2 Computer Studies Examination (Third Term)
Ejiro Ndifereke
 
Android Internals
Android InternalsAndroid Internals
Android Internals
Opersys inc.
 
Ppt
PptPpt
Ppt
Bala Ji
 
Computer Networking Multiple Choice Questions
Computer Networking Multiple Choice QuestionsComputer Networking Multiple Choice Questions
Computer Networking Multiple Choice Questions
Shusil Baral
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
National Cheng Kung University
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
Danny Abukalam
 
Gpu
GpuGpu
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
mshellman
 
Understanding binder in android
Understanding binder in androidUnderstanding binder in android
Understanding binder in android
Haifeng Li
 

What's hot (20)

Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Computer architecture mcq (2)
Computer architecture mcq (2)Computer architecture mcq (2)
Computer architecture mcq (2)
 
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
JSS2 COMPUTER STUDIES EXAMINATION (FIRST TERM)
 
Scripting and automation with the Men & Mice Suite
Scripting and automation with the Men & Mice SuiteScripting and automation with the Men & Mice Suite
Scripting and automation with the Men & Mice Suite
 
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
S3 DATA PROCESSING FIRST TERM PRE-WAEC (2ND HALF EXAMINATION)
 
computer fundamental mcq 300 questions
computer fundamental mcq 300 questionscomputer fundamental mcq 300 questions
computer fundamental mcq 300 questions
 
Android OTA updates
Android OTA updatesAndroid OTA updates
Android OTA updates
 
Graphics Processing Unit - GPU
Graphics Processing Unit - GPUGraphics Processing Unit - GPU
Graphics Processing Unit - GPU
 
Introduction to programming concepts
Introduction to programming conceptsIntroduction to programming concepts
Introduction to programming concepts
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Elements of programming
Elements of programmingElements of programming
Elements of programming
 
JS2 Computer Studies Examination (Third Term)
JS2 Computer Studies Examination (Third Term)JS2 Computer Studies Examination (Third Term)
JS2 Computer Studies Examination (Third Term)
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Ppt
PptPpt
Ppt
 
Computer Networking Multiple Choice Questions
Computer Networking Multiple Choice QuestionsComputer Networking Multiple Choice Questions
Computer Networking Multiple Choice Questions
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
 
Gpu
GpuGpu
Gpu
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Understanding binder in android
Understanding binder in androidUnderstanding binder in android
Understanding binder in android
 

Viewers also liked

Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
khair20
 
Introduction to programming01
Introduction to programming01Introduction to programming01
Introduction to programming01
Nadim Ahmed
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
NSU-Biliran Campus
 
CS201- Introduction to Programming- Lecture 01
CS201- Introduction to Programming- Lecture 01CS201- Introduction to Programming- Lecture 01
CS201- Introduction to Programming- Lecture 01
Bilal Ahmed
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
Stoian Kirov
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
indiangarg
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
Sangheethaa Sukumaran
 

Viewers also liked (7)

Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Introduction to programming01
Introduction to programming01Introduction to programming01
Introduction to programming01
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
CS201- Introduction to Programming- Lecture 01
CS201- Introduction to Programming- Lecture 01CS201- Introduction to Programming- Lecture 01
CS201- Introduction to Programming- Lecture 01
 
01. introduction to-programming
01. introduction to-programming01. introduction to-programming
01. introduction to-programming
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 

Similar to Fundamentals of programming and problem solving

Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
Mithun DSouza
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
aaravSingh41
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming Language
Prof Ansari
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
SURBHI SAROHA
 
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptx
Subramanian Mani
 
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
 
Computer programming languages
Computer programming languagesComputer programming languages
Computer programming languages
SubramanianMuthusamy3
 
Unit 2 ppt
Unit 2 pptUnit 2 ppt
Unit 2 ppt
Mitali Chugh
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
Mugilvannan11
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
skashwin98
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
ManiMala75
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
ManiMala75
 
Unit 1.1 - Introduction to C.pptx
Unit 1.1 - Introduction to C.pptxUnit 1.1 - Introduction to C.pptx
Unit 1.1 - Introduction to C.pptx
NandhaGopal Subramani
 
C programming course material
C programming course materialC programming course material
C programming course material
Ranjitha Murthy
 
C programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdfC programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdf
ComedyTechnology
 
C Programming language - introduction
C Programming  language - introduction  C Programming  language - introduction
C Programming language - introduction
GopikaS12
 
D turner techreport
D turner techreportD turner techreport
D turner techreport
david114811
 
C programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakilC programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakil
Zenith SVG
 
C programming language Reference Note
C programming language Reference NoteC programming language Reference Note
C programming language Reference Note
Chetan Thapa Magar
 
C vs c++
C vs c++C vs c++
C vs c++
Gaurav Badhan
 

Similar to Fundamentals of programming and problem solving (20)

Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
 
The C++ Programming Language
The C++ Programming LanguageThe C++ Programming Language
The C++ Programming Language
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
computerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptxcomputerprogramminglanguages-201216152310.pptx
computerprogramminglanguages-201216152310.pptx
 
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
 
Computer programming languages
Computer programming languagesComputer programming languages
Computer programming languages
 
Unit 2 ppt
Unit 2 pptUnit 2 ppt
Unit 2 ppt
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
 
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
 
Unit 1.1 - Introduction to C.pptx
Unit 1.1 - Introduction to C.pptxUnit 1.1 - Introduction to C.pptx
Unit 1.1 - Introduction to C.pptx
 
C programming course material
C programming course materialC programming course material
C programming course material
 
C programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdfC programming language tutorial for beginers.pdf
C programming language tutorial for beginers.pdf
 
C Programming language - introduction
C Programming  language - introduction  C Programming  language - introduction
C Programming language - introduction
 
D turner techreport
D turner techreportD turner techreport
D turner techreport
 
C programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakilC programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakil
 
C programming language Reference Note
C programming language Reference NoteC programming language Reference Note
C programming language Reference Note
 
C vs c++
C vs c++C vs c++
C vs c++
 

Recently uploaded

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
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
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
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
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
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
 

Recently uploaded (20)

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
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
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
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
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
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
 

Fundamentals of programming and problem solving

  • 1. Fundamentals of Programming and Problem Solving SUBJECT The C Language Assignment #1 Name: Justine dela Serna Course/ Year: BSIT-I
  • 2. The History of the C Language The C programming language was devised in the early 1970s by Dennis M. Ritchie an employee from Bell Labs (AT&T). In the 1960s Ritchie worked, with several other employees of Bell Labs (AT&T), on a project called Multics. The goal of the project was to develop an operating system for a large computer that could be used by a thousand users. In 1969 AT&T (Bell Labs) withdrew from the project, because the project could not produce an economically useful system. So the employees of Bell Labs (AT&T) had to search for another project to work on (mainly Dennis M. Ritchie and Ken Thompson). Ken Thompson began to work on the development of a new file system. He wrote, a version of the new file system for the DEC PDP-7, in assembler. (The new file system was also used for the game Space Travel). Soon they began to make improvements and add expansions. (They used their knowledge from the Multics project to add improvements). After a while a complete system was born. Brian W. Kernighan called the system UNIX, a sarcastic reference to Multics. The whole system was still written in assembly code. Besides assembler and Fortran, UNIX also had an interpreter for the programming language B. (The B language is derived directly from Martin Richards BCPL). The language B was developed in 1969-70 by Ken Thompson. In the early days computer code was written in assembly code. To perform a specific task, you had to write many pages of code. A high-level language like B made it possible to write the same task in just a few lines of code. The language B was used for further development of the UNIX system. Because of the high-level of the B language, code could be produced much faster, then in assembly. A drawback of the B language was that it did not know data-types. (Everything was expressed in machine words). Another functionality that the B language did not provide was the use of “structures”. The lag of these things formed the reason for Dennis M. Ritchie to develop the programming language C. So in 1971-73 Dennis M. Ritchie turned the B language into the C language, keeping most of the language B syntax while adding data-types and many other changes. The C language had a powerful mix of high-level functionality and the detailed features required to program an operating system. Therefore many of the UNIX components were eventually rewritten in C (the Unix kernel itself was rewritten in 1973 on a DEC PDP-11). The programming language C was written down, by Kernighan and Ritchie, in a now classic book called “The C Programming Language, 1st edition”. (Kernighan has said that he had no part in the design of the C language: “It’s entirely Dennis Ritchie’s work”. But he is the author of the famous “Hello, World” program and many other UNIX programs). For years the book “The C Programming Language, 1st edition” was the standard on the language C. In 1983 a committee was formed by the American National Standards Institute (ANSI) to develop a modern definition for the programming language C (ANSI X3J11). In 1988 they delivered the final standard definition ANSI C. (The standard was based on the book from K&R 1st Ed.). The standard ANSI C made little changes on the original design of the C language. (They had to make sure that old programs still worked with the new standard). Later on, the ANSI C standard was adopted by the International Standards Organization (ISO). The correct term should therefore be ISO C, but everybody still calls it ANSI C.
  • 3. Environment of C Language Like most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within subroutines, which are called "functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements. C is often used for "system programming", including implementing operating systems and embedded system applications, due to a combination of desirable characteristics such as code portability and efficiency, ability to access specific hardware addresses, ability to pun types to match externally imposed data access requirements, and low run-time demand on system resources. C can also be used for website programming using CGI as a "gateway" for information between the Web application, the server, and the browser.[29] Some reasons for choosing C over interpreted languages are its speed, stability, and near-universal availability. One consequence of C's wide availability and efficiency is that compilers, libraries, and interpreters of other programming languages are often implemented in C. The primary implementations of Python (CPython), Perl 5, and PHP are all written in C. Due to its thin layer of abstraction and low overhead, C allows efficient implementations of algorithms and data structures, which is useful for programs that perform a lot of computations. For example, the GNU Multi-Precision Library, the GNU Scientific Library, Mathematica and MATLAB are completely or partially written in C. C is sometimes used as an intermediate language by implementations of other languages. This approach may be used for portability or convenience; by using C as an intermediate language, it is not necessary to develop machine-specific code generators. C has some features, such as line-number preprocessor directives and optional superfluous commas at the end of initializer lists, which support compilation of generated code. However, some of C's shortcomings have prompted the development of other C-based languages specifically designed for use as intermediate languages, such as C--. C has also been widely used to implement end-user applications, but much of that development has shifted to newer languages.
  • 4.  Elements of C : C Tokens: Keyword Identifier Constant String-literal Operator Punctuator C Constants: floating-point integer enumeration character C Keywords: auto break case default else float goto int long register sizeof typedef unsigned volatile while C Identifiers: float _number; float a; int ; The following are illegal (it's your job to recognize why): float :e; float for; float 9PI; float .3.14; float 7g; C String Literals: (any member of the source character set except the double quotation mark ("), backslash (), or newline character) " s-char-sequence opt " L" s-char-sequence opt " s-char-sequence: The example below is a simple string literal: char *amessage = "This is a string literal."; Punctuation and Special Characters: [ ] ( ) { } * , : = ; ... # The pound sign (#) can occur only in preprocessing directives.
  • 5. CONSTANT In computer programming, a constant is an identifier whose associated value cannot typically be altered by the program during its execution (though in some cases this can be circumvented, e.g. using self-modifying code). Many programming languages make an explicit syntactic distinction between constant and variable symbols. Although a constant's value is specified only once, a constant may be referenced many times in a program. Using a constant instead of specifying a value multiple times in the program can not only simplify code maintenance, but it can also supply a meaningful name for it and consolidate such constant bindings to a standard code location (for example, at the beginning). VARIABLE In computer programming, a variable is a storage location and an associated symbolic name (an identifier) which contains some known or unknown quantity or information, a value. The variable name is the usual way to reference the stored value; this separation of name and content allows the name to be used independently of the exact information it represents. The identifier in computer source code can be bound to a value during run time, and the value of the variable may thus change during the course of program execution. Variables in programming may not directly correspond to the concept of variables in mathematics. The value of a computing variable is not necessarily part of an equation or formula as in mathematics. In computing, a variable may be employed in a repetitive process: assigned a value in one place, then used elsewhere, then reassigned a new value and used again in the same way (see iteration). Variables in computer programming are frequently given long names to make them relatively descriptive of their use, whereas variables in mathematics often have terse, one- or two-character names for brevity in transcription and manipulation. A variable storage location may be referred by several different identifiers, a situation known as aliasing. Assigning a value to the variable using one of the identifiers will change the value that can be accessed through the other identifiers. Compilers have to replace variables' symbolic names with the actual locations of the data. While a variable's name, type, and location often remain fixed, the data stored in the location may be changed during program execution. DATATYPE In computer science and computer programming, a data type or simply type is a classification identifying one of various types of data, such as real-valued, integer or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of that type can be stored.Data types are used within type systems, which offer various ways of defining, implementing and using them. Different type systems ensure varying degrees of type safety. Formally, a type can be defined as "any property of a programme we can determine without executing the program". Almost all programming languages explicitly include the notion of data type, though different languages may use different terminology. Justine dela Serna BSIT-I