SlideShare a Scribd company logo
Introduction to
Programming
 Programming is writing computer code to create a
program, to solve a problem. Programs are
created to implement algorithms. Algorithms can
be represented as pseudo code or a flowchart,
and programming is the translation of these into a
computer program.
 To tell a computer to do something, a program
must be written to tell it exactly what to do and how
to do it. If an algorithm has been designed, the
computer program will follow this algorithm, step-
by-step, which will tell the computer exactly what it
should do.
Programming Language
A programming language is an
artificial language that a computer
understands. The language is made up
of series of statements that fit together
to form instructions. These instructions
tell a computer what to do.
Categories of Languages
Each programming language contains a unique
set of keywords and syntax, which are used to
create a set of instructions. Thousands of
programming languages have been developed
till now, but each language has its specific
purpose. These languages vary in the level of
abstraction they provide from the hardware.
Some programming languages provide less or
no abstraction while some provide higher
abstraction. Based on the levels of abstraction,
they can be classified into two categories:
 Low-level language
 High-level language
Low Level Language
The low-level language is a programming
language that provides no abstraction
from the hardware, and it is represented
in 0 or 1 forms, which are the machine
instructions. The languages that come
under this category are the Machine
level language and Assembly language.
Machine-level language
The machine-level language is a language
that consists of a set of instructions that
are in the binary form 0 or 1. As we
know that computers can understand
only machine instructions, which are in
binary digits, i.e., 0 and 1, so the
instructions given to the computer can
be only in binary codes.
Assembly Language
The assembly language contains some
human-readable commands such as mov,
add, sub, etc. The problems which we were
facing in machine-level language are
reduced to some extent by using an
extended form of machine-level language
known as assembly language. Since
assembly language instructions are written
in English words like mov, add, sub, so it is
easier to write and understand.
Ex. ADD(2,4)
Assembler
As we know that computers can only
understand the machine-level
instructions, so we require a translator
that converts the assembly code into
machine code. The translator used for
translating the code is known as an
assembler.
High-Level Language
The high-level language is a programming
language that allows a programmer to
write the programs which are
independent of a particular type of
computer. The high-level languages are
considered as high-level because they
are closer to human languages than
machine-level languages.
History of C Language
 History of C language is interesting to
know. Here we are going to discuss a brief
history of the c language.
 C programming language was developed
in 1972 by Dennis Ritchie at bell laboratories
of AT&T (American Telephone & Telegraph),
located in the U.S.A.
 Dennis Ritchie is known as the founder of
the c language.
 It was developed to overcome the problems
of previous languages such as B, BCPL, etc.
Features of C Language
Structure of a C Program
First C Program
 #include <stdio.h>
 int main()
 {
 printf("Hello C Language");
 return 0;
 }
Elements of C
Execution Characters/Escape
Sequences
Tokens in C
Keywords in C
Keywords in C can be defined as the pre-
defined or the reserved words having
its own importance, and each keyword
has its own functionality. Since
keywords are the pre-defined words
used by the compiler, so they cannot be
used as the variable names.
Identifiers in C
Identifiers in C are used for naming variables, functions, arrays,
structures, etc. Identifiers in C are the user-defined words. It can be
composed of uppercase letters, lowercase letters, underscore, or digits,
but the starting letter should be either an underscore or an alphabet.
Identifiers cannot be used as keywords. Rules for constructing
identifiers in C are given below:
 The first character of an identifier should be either an alphabet or an
underscore, and then it can be followed by any of the character, digit,
or underscore.
 It should not begin with any numerical digit.
 In identifiers, both uppercase and lowercase letters are distinct.
Therefore, we can say that identifiers are case sensitive.
 Commas or blank spaces cannot be specified within an identifier.
 Keywords cannot be represented as an identifier.
 The length of the identifiers should not be more than 31 characters.
 Identifiers should be written in such a way that it is meaningful, short,
and easy to read.
Strings in C
String are always represented as an array of
characters having null character '0' at the
end of the string. This null character
denotes the end of the string. Strings in C
are enclosed within double quotes, while
characters are enclosed within single
characters. The size of a string is a number
of characters that the string contains.
Now, we describe the strings in different
ways:
char a[10] = "javatpoint"; // The compiler
allocates the 10 bytes to the 'a' array.
Constants in C
A constant is a value assigned to the
variable which will remain the same
throughout the program, i.e., the
constant value cannot be changed.
There are two ways of declaring constant:
 Using const keyword
 Using #define pre-processor
Special characters in C
Some special characters are used in C, and they have a special meaning
which cannot be used for another purpose.
 Square brackets [ ]: The opening and closing brackets represent the
single and multidimensional subscripts.
 Simple brackets ( ): It is used in function declaration and function
calling. For example, printf() is a pre-defined function.
 Curly braces { }: It is used in the opening and closing of the code. It is
used in the opening and closing of the loops.
 Comma (,): It is used for separating for more than one statement and
for example, separating function parameters in a function call,
separating the variable when printing the value of more than one
variable using a single printf statement.
 Hash/pre-processor (#): It is used for pre-processor directive. It
basically denotes that we are using the header file.
 Asterisk (*): This symbol is used to represent pointers and also used
as an operator for multiplication.
 Tilde (~): It is used as a destructor to free memory.
 Period (.): It is used to access a member of a structure or a union.
Variables in C
 A variable is a name of the memory
location. It is used to store data. Its
value can be changed, and it can be
reused many times.
 It is a way to represent memory location
through symbol so that it can be easily
identified.
 Let's see the syntax to declare a
variable:
 type variable_list;
 int a=10,b=20;//declaring 2 variable of intege
r type
 float f=20.8;
 char c='A';
Types of Variables in C
 There are many types of variables in c:
 local variable
 global variable
 static variable
 automatic variable
 external variable
cunit1.pptx
cunit1.pptx
cunit1.pptx
cunit1.pptx

More Related Content

Similar to cunit1.pptx

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 programme presentation
C programme presentationC programme presentation
C programme presentation
DharmaKumariBhandari
 
Unit 1
Unit 1Unit 1
Unit 1
TPLatchoumi
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
DeveshKatiyar5
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
Muthuselvam RS
 
Copy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptxCopy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptx
rahulrajbhar06478
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
sumitbardhan
 
Cnotes
CnotesCnotes
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
SIMONTHOMAS S
 
C notes
C notesC notes
C notes
Raunak Sodhi
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Preeti Kashyap
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Basics of c
Basics of cBasics of c
Basics of c
vinothini1996
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
arpanabharani
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
Introduction to programming c
Introduction to programming cIntroduction to programming c
Introduction to programming c
Md. Rakibuzzaman Khan Pathan
 
Aniket tore
Aniket toreAniket tore
Aniket tore
anikettore1
 
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
SushmaG48
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
Uniti classnotes
Uniti classnotesUniti classnotes
Uniti classnotes
Sowri Rajan
 

Similar to cunit1.pptx (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 programme presentation
C programme presentationC programme presentation
C programme presentation
 
Unit 1
Unit 1Unit 1
Unit 1
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
Copy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptxCopy of UNIT 2 -- Basics Of Programming.pptx
Copy of UNIT 2 -- Basics Of Programming.pptx
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
 
Cnotes
CnotesCnotes
Cnotes
 
SPC Unit 2
SPC Unit 2SPC Unit 2
SPC Unit 2
 
C notes
C notesC notes
C notes
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Basics of c
Basics of cBasics of c
Basics of c
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
C language ppt
C language pptC language ppt
C language ppt
 
Introduction to programming c
Introduction to programming cIntroduction to programming c
Introduction to programming c
 
Aniket tore
Aniket toreAniket tore
Aniket tore
 
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
 
C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
Uniti classnotes
Uniti classnotesUniti classnotes
Uniti classnotes
 

More from zeenatparveen24

8 Normalization (1).ppt
8 Normalization (1).ppt8 Normalization (1).ppt
8 Normalization (1).ppt
zeenatparveen24
 
Cunit3.pdf
Cunit3.pdfCunit3.pdf
Cunit3.pdf
zeenatparveen24
 
pointers.pptx
pointers.pptxpointers.pptx
pointers.pptx
zeenatparveen24
 
COCOMO.pptx
COCOMO.pptxCOCOMO.pptx
COCOMO.pptx
zeenatparveen24
 
4 B-Coupling and Cohesion-1.pptx
4 B-Coupling and Cohesion-1.pptx4 B-Coupling and Cohesion-1.pptx
4 B-Coupling and Cohesion-1.pptx
zeenatparveen24
 
Unit II.pptx
Unit II.pptxUnit II.pptx
Unit II.pptx
zeenatparveen24
 

More from zeenatparveen24 (6)

8 Normalization (1).ppt
8 Normalization (1).ppt8 Normalization (1).ppt
8 Normalization (1).ppt
 
Cunit3.pdf
Cunit3.pdfCunit3.pdf
Cunit3.pdf
 
pointers.pptx
pointers.pptxpointers.pptx
pointers.pptx
 
COCOMO.pptx
COCOMO.pptxCOCOMO.pptx
COCOMO.pptx
 
4 B-Coupling and Cohesion-1.pptx
4 B-Coupling and Cohesion-1.pptx4 B-Coupling and Cohesion-1.pptx
4 B-Coupling and Cohesion-1.pptx
 
Unit II.pptx
Unit II.pptxUnit II.pptx
Unit II.pptx
 

Recently uploaded

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
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
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
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
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
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
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
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
 
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
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
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
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
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
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
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
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
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
 
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
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

cunit1.pptx

  • 1.
  • 2. Introduction to Programming  Programming is writing computer code to create a program, to solve a problem. Programs are created to implement algorithms. Algorithms can be represented as pseudo code or a flowchart, and programming is the translation of these into a computer program.  To tell a computer to do something, a program must be written to tell it exactly what to do and how to do it. If an algorithm has been designed, the computer program will follow this algorithm, step- by-step, which will tell the computer exactly what it should do.
  • 3. Programming Language A programming language is an artificial language that a computer understands. The language is made up of series of statements that fit together to form instructions. These instructions tell a computer what to do.
  • 4. Categories of Languages Each programming language contains a unique set of keywords and syntax, which are used to create a set of instructions. Thousands of programming languages have been developed till now, but each language has its specific purpose. These languages vary in the level of abstraction they provide from the hardware. Some programming languages provide less or no abstraction while some provide higher abstraction. Based on the levels of abstraction, they can be classified into two categories:  Low-level language  High-level language
  • 5. Low Level Language The low-level language is a programming language that provides no abstraction from the hardware, and it is represented in 0 or 1 forms, which are the machine instructions. The languages that come under this category are the Machine level language and Assembly language.
  • 6. Machine-level language The machine-level language is a language that consists of a set of instructions that are in the binary form 0 or 1. As we know that computers can understand only machine instructions, which are in binary digits, i.e., 0 and 1, so the instructions given to the computer can be only in binary codes.
  • 7. Assembly Language The assembly language contains some human-readable commands such as mov, add, sub, etc. The problems which we were facing in machine-level language are reduced to some extent by using an extended form of machine-level language known as assembly language. Since assembly language instructions are written in English words like mov, add, sub, so it is easier to write and understand. Ex. ADD(2,4)
  • 8. Assembler As we know that computers can only understand the machine-level instructions, so we require a translator that converts the assembly code into machine code. The translator used for translating the code is known as an assembler.
  • 9.
  • 10. High-Level Language The high-level language is a programming language that allows a programmer to write the programs which are independent of a particular type of computer. The high-level languages are considered as high-level because they are closer to human languages than machine-level languages.
  • 11.
  • 12.
  • 13. History of C Language  History of C language is interesting to know. Here we are going to discuss a brief history of the c language.  C programming language was developed in 1972 by Dennis Ritchie at bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A.  Dennis Ritchie is known as the founder of the c language.  It was developed to overcome the problems of previous languages such as B, BCPL, etc.
  • 14.
  • 15. Features of C Language
  • 16. Structure of a C Program
  • 17. First C Program  #include <stdio.h>  int main()  {  printf("Hello C Language");  return 0;  }
  • 21. Keywords in C Keywords in C can be defined as the pre- defined or the reserved words having its own importance, and each keyword has its own functionality. Since keywords are the pre-defined words used by the compiler, so they cannot be used as the variable names.
  • 22.
  • 23. Identifiers in C Identifiers in C are used for naming variables, functions, arrays, structures, etc. Identifiers in C are the user-defined words. It can be composed of uppercase letters, lowercase letters, underscore, or digits, but the starting letter should be either an underscore or an alphabet. Identifiers cannot be used as keywords. Rules for constructing identifiers in C are given below:  The first character of an identifier should be either an alphabet or an underscore, and then it can be followed by any of the character, digit, or underscore.  It should not begin with any numerical digit.  In identifiers, both uppercase and lowercase letters are distinct. Therefore, we can say that identifiers are case sensitive.  Commas or blank spaces cannot be specified within an identifier.  Keywords cannot be represented as an identifier.  The length of the identifiers should not be more than 31 characters.  Identifiers should be written in such a way that it is meaningful, short, and easy to read.
  • 24. Strings in C String are always represented as an array of characters having null character '0' at the end of the string. This null character denotes the end of the string. Strings in C are enclosed within double quotes, while characters are enclosed within single characters. The size of a string is a number of characters that the string contains. Now, we describe the strings in different ways: char a[10] = "javatpoint"; // The compiler allocates the 10 bytes to the 'a' array.
  • 25. Constants in C A constant is a value assigned to the variable which will remain the same throughout the program, i.e., the constant value cannot be changed. There are two ways of declaring constant:  Using const keyword  Using #define pre-processor
  • 26.
  • 27. Special characters in C Some special characters are used in C, and they have a special meaning which cannot be used for another purpose.  Square brackets [ ]: The opening and closing brackets represent the single and multidimensional subscripts.  Simple brackets ( ): It is used in function declaration and function calling. For example, printf() is a pre-defined function.  Curly braces { }: It is used in the opening and closing of the code. It is used in the opening and closing of the loops.  Comma (,): It is used for separating for more than one statement and for example, separating function parameters in a function call, separating the variable when printing the value of more than one variable using a single printf statement.  Hash/pre-processor (#): It is used for pre-processor directive. It basically denotes that we are using the header file.  Asterisk (*): This symbol is used to represent pointers and also used as an operator for multiplication.  Tilde (~): It is used as a destructor to free memory.  Period (.): It is used to access a member of a structure or a union.
  • 28. Variables in C  A variable is a name of the memory location. It is used to store data. Its value can be changed, and it can be reused many times.  It is a way to represent memory location through symbol so that it can be easily identified.  Let's see the syntax to declare a variable:  type variable_list;
  • 29.  int a=10,b=20;//declaring 2 variable of intege r type  float f=20.8;  char c='A';
  • 30. Types of Variables in C  There are many types of variables in c:  local variable  global variable  static variable  automatic variable  external variable

Editor's Notes

  1. #include <stdio.h> includes the standard input output library functions. The printf() function is defined in stdio.h . int main() The main() function is the entry point of every program in c language. printf() The printf() function is used to print data on the console. return 0 The return 0 statement, returns execution status to the OS. The 0 value is used for successful execution and 1 for unsuccessful execution.