SlideShare a Scribd company logo
1 of 26
Presented by-
Shivani Verma
E.E 2nd Year
Roll no. -190422020039
• Introduction
• Types of Tokens
• Operators
• The C character set
• Structure of program
• Data Type
• If else
• Switch case
• Looping
• Array
• Function
 C is a programming language developed at
A.T & T Bell laboratories of USA in 1972,
designed and written by “Dennis Ritchie”.
 C is a structural programming language.
 C is highly portable.
 A C program is basically a collection of
functions.
1. Keywords
2. Identifiers
3. Constants
4. Strings
5. Special symbols
6. Operators
 Keywords are predefined tokens in C. These
are also called reserved words.
 Keywords have special meaning to the C
compiler.
 C has 32 keywords.
 These keywords can be used only for their
intended action
Identifiers are distinct names given to program
elements such as constants, variables, etc.
An identifier is a sequence of letters , digits and
the special character ’_’(underscore).
A constant is a fixed value that cannot be
altered during the execution of a program.
C constants can be classified into two categories.
 Primary Constants
 Secondary Constants
 A string constant is a sequence of characters
enclosed in double quotes.
 The characters may be letters , numbers, blank
space or special characters.
 The term variable is used to denote any value
that is referred to a name instead of explicit
value.
 A variable is able to hold different values
during execution of a program, where as a
constant is restricted to just one value.
 For example, in equation 2x+3y=10; since x and
y can change, they are variables.
 An operator is a symbol that tells the computer
to perform certain mathematical or logical
manipulations.
 Operators are used in program to manipulate
data and variables. The data items that
operators act upon are called operands.
C has four classes of operators
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Bit-wise Operators
C has some special operators-
1. Increment & Decrement Operators
2. Conditional Operators
3. Assignment Operators, etc.
 There are five arithmetic operators in C.
Operator Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo division
 Relational Operators are symbols that are used to
test the relationship between two variable and a
consonant.
 C has six relational operators.
Operator Meaning
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
== Equal to
!= Not equal to
 Logical operators are symbols that are used to
combine or negate expressions containing
relational operators.
 C has three logical operators.
Operator Meaning
&& Logical AND
|| Logical OR
! Logical NOT
 The lowest logical element in the memory is bit.
 These operators work only with int and char data
types and cannot be used with float and double type.
 Following bitwise operators are available in C.
Operator Meaning
- One’s Complement
| Bitwise OR
& Bitwise AND
^ Bitwise Exclusive OR(XOR)
>> Right Shift
<< Left Shift
In addition to usual assignment operator=,C has a set of
short hand operators, that simplifies the coding of a
certain type of assignment statement.
It is of the form
var op= exp
Where var is a variable, op is a C binary arithmetic
operator and exp is an expression.
Statement Equivalent Statement
a+=b a= a+b
a-=b a=a-b
a*=b a=a*b
a*=b+c a=a*(b+c)
a%=b a=a%b
a*=a a=a*a
The C character set includes the upper case
letters A to Z , the decimal digits 0 to 9 and
certain special characters.
 Letters a,b,c,………………z
 Digits 0,1,2,3,4,5,6,7,8,9
 Special characters ~,.;:?’!”(){}[]/<>=+-
$#@&*%^
 A simple program for printing a message.
#include<stdio.h>
#include<conio.h>
Void main()
{
clrscr();
printf(“Welcome to C”);
getch();
}
A data type in a programming language is a set of
data values having predefine characteristics.
There are three classes of data types:
Data Type
Primitive Derived User defined
 In C language compiler support five
fundamental data type namely integer(int),
character(char), floating point(float), double
and void.
 Derived data types are array, structure, pointer,
function.
 A user define data type is basically made by
user itself.
The if statement is a powerful decision making
statement .
If…else statement is a extension of the simple if
statement .The general form is:
If(test expression)
{
true-block statement(s)
}
else
{
false-block statement(s)
}
It is a control statement that provides a facility for
multiway branching from a particular point.
Syntax:
switch(expression)
{
case labels:
break;
}
To execute a set of instructions repeatedly until a
particular condition is being satisfied.
LOOP
For loop while loop Do while loop
 For loop-
For (initialization; test condition; increment)
{
Body of the loop
}
 While loop-
While (test condition)
{
Body of the loop
}
 Do while loop-
do
{
Body of the loop
}
An array is a collection of elements of the same
data type.
Syntax:
Data type array name [size];
Type of array
1dimensional 2dimensional Multi-dimensional
A function definition specifies the name of the
function, the types and number of parameters
it expects to receive, and its return type.
Types of functions
Built in function User define function

More Related Content

Similar to Shivani PPt C-programing-1.pptx

Similar to Shivani PPt C-programing-1.pptx (20)

M.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageM.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C Language
 
C notes
C notesC notes
C notes
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Funa-C.ppt
Funa-C.pptFuna-C.ppt
Funa-C.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C (1).ppt
Basics of C (1).pptBasics of C (1).ppt
Basics of C (1).ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
C programming basic pdf.ppt
C programming basic pdf.pptC programming basic pdf.ppt
C programming basic pdf.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C--C Basics------------------.ppt
Basics of C--C Basics------------------.pptBasics of C--C Basics------------------.ppt
Basics of C--C Basics------------------.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
Basics of C (1).ppt
Basics of C (1).pptBasics of C (1).ppt
Basics of C (1).ppt
 
Basics of c
Basics of cBasics of c
Basics of c
 
C programming
C programming C programming
C programming
 
Basics of C
Basics of CBasics of C
Basics of C
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
 

Recently uploaded

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 

Recently uploaded (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 

Shivani PPt C-programing-1.pptx

  • 1. Presented by- Shivani Verma E.E 2nd Year Roll no. -190422020039
  • 2. • Introduction • Types of Tokens • Operators • The C character set • Structure of program • Data Type • If else • Switch case • Looping • Array • Function
  • 3.  C is a programming language developed at A.T & T Bell laboratories of USA in 1972, designed and written by “Dennis Ritchie”.  C is a structural programming language.  C is highly portable.  A C program is basically a collection of functions.
  • 4. 1. Keywords 2. Identifiers 3. Constants 4. Strings 5. Special symbols 6. Operators
  • 5.  Keywords are predefined tokens in C. These are also called reserved words.  Keywords have special meaning to the C compiler.  C has 32 keywords.  These keywords can be used only for their intended action
  • 6. Identifiers are distinct names given to program elements such as constants, variables, etc. An identifier is a sequence of letters , digits and the special character ’_’(underscore).
  • 7. A constant is a fixed value that cannot be altered during the execution of a program. C constants can be classified into two categories.  Primary Constants  Secondary Constants
  • 8.  A string constant is a sequence of characters enclosed in double quotes.  The characters may be letters , numbers, blank space or special characters.
  • 9.  The term variable is used to denote any value that is referred to a name instead of explicit value.  A variable is able to hold different values during execution of a program, where as a constant is restricted to just one value.  For example, in equation 2x+3y=10; since x and y can change, they are variables.
  • 10.  An operator is a symbol that tells the computer to perform certain mathematical or logical manipulations.  Operators are used in program to manipulate data and variables. The data items that operators act upon are called operands.
  • 11. C has four classes of operators 1. Arithmetic Operators 2. Relational Operators 3. Logical Operators 4. Bit-wise Operators C has some special operators- 1. Increment & Decrement Operators 2. Conditional Operators 3. Assignment Operators, etc.
  • 12.  There are five arithmetic operators in C. Operator Meaning + Addition - Subtraction * Multiplication / Division % Modulo division
  • 13.  Relational Operators are symbols that are used to test the relationship between two variable and a consonant.  C has six relational operators. Operator Meaning > Greater than >= Greater than or equal to < Less than <= Less than or equal to == Equal to != Not equal to
  • 14.  Logical operators are symbols that are used to combine or negate expressions containing relational operators.  C has three logical operators. Operator Meaning && Logical AND || Logical OR ! Logical NOT
  • 15.  The lowest logical element in the memory is bit.  These operators work only with int and char data types and cannot be used with float and double type.  Following bitwise operators are available in C. Operator Meaning - One’s Complement | Bitwise OR & Bitwise AND ^ Bitwise Exclusive OR(XOR) >> Right Shift << Left Shift
  • 16. In addition to usual assignment operator=,C has a set of short hand operators, that simplifies the coding of a certain type of assignment statement. It is of the form var op= exp Where var is a variable, op is a C binary arithmetic operator and exp is an expression. Statement Equivalent Statement a+=b a= a+b a-=b a=a-b a*=b a=a*b a*=b+c a=a*(b+c) a%=b a=a%b a*=a a=a*a
  • 17. The C character set includes the upper case letters A to Z , the decimal digits 0 to 9 and certain special characters.  Letters a,b,c,………………z  Digits 0,1,2,3,4,5,6,7,8,9  Special characters ~,.;:?’!”(){}[]/<>=+- $#@&*%^
  • 18.  A simple program for printing a message. #include<stdio.h> #include<conio.h> Void main() { clrscr(); printf(“Welcome to C”); getch(); }
  • 19. A data type in a programming language is a set of data values having predefine characteristics. There are three classes of data types: Data Type Primitive Derived User defined
  • 20.  In C language compiler support five fundamental data type namely integer(int), character(char), floating point(float), double and void.  Derived data types are array, structure, pointer, function.  A user define data type is basically made by user itself.
  • 21. The if statement is a powerful decision making statement . If…else statement is a extension of the simple if statement .The general form is: If(test expression) { true-block statement(s) } else { false-block statement(s) }
  • 22. It is a control statement that provides a facility for multiway branching from a particular point. Syntax: switch(expression) { case labels: break; }
  • 23. To execute a set of instructions repeatedly until a particular condition is being satisfied. LOOP For loop while loop Do while loop
  • 24.  For loop- For (initialization; test condition; increment) { Body of the loop }  While loop- While (test condition) { Body of the loop }  Do while loop- do { Body of the loop }
  • 25. An array is a collection of elements of the same data type. Syntax: Data type array name [size]; Type of array 1dimensional 2dimensional Multi-dimensional
  • 26. A function definition specifies the name of the function, the types and number of parameters it expects to receive, and its return type. Types of functions Built in function User define function