Syntax of
if control structure in C
Relational Operators in C
Operator

Meaning

Example

Value of the
expression

<

less than

age < 30

>

greater than

height > 6.2

<=

less than or equal to

taxable <= 20000

Value is 0
(Zero) if
expression is
false

>=

greater than or equal to

temperature >= 98.6

==

equal to

marks == 100

!=

not equal to

number != 250

Value is 1 (one)
if expression is
True
if(x<y)
{
……….
……….
}
if(‘a’<‘P’)
{
……….
……….
}

If x contains 5 and y contains 10
then value of the expression is
1 and condition is true
If x contains 10 and y contains 4
then value of the expression is
0 and condition is false

As ASCII value of A is 97 and ASCII
value of P is 80 the expression is
false and value of the expression
is 0
If block
if(-5)
{
……….
……….
}

Valid condition. -5 is a truth
value and is non zero. So value
of the expression is 1 and
statement is true!

if(x)
{
……….
……….
}

If x contains any non zero value
the expression is true and value of
the expression is 1.
If x contains zero, value of the
expression is 0 and statement is
false

More Related Content

PPSX
Relational Operators in C Language
PDF
Day 5 examples u5w14
PDF
New day 5 examples
PPT
Polynomial and thier graphs
PPTX
Graphing polynomial functions by tabby
PPT
Calculator mockseminar
PDF
Polynomials lecture
PPT
Comp102 lec 5.0
Relational Operators in C Language
Day 5 examples u5w14
New day 5 examples
Polynomial and thier graphs
Graphing polynomial functions by tabby
Calculator mockseminar
Polynomials lecture
Comp102 lec 5.0

What's hot (11)

PPTX
Graph of quadratic function
PPTX
Additive inverse
PPTX
Additive inverse
PDF
Rational functions lecture
PPTX
Graph of a linear function
PDF
4. operators in c programming by digital wave
PPTX
Factorizacion clase 1
PDF
Functions lect
PPT
Rational Function
PPT
4.2 vertex and intercept form
DOC
Dba matlab code
Graph of quadratic function
Additive inverse
Additive inverse
Rational functions lecture
Graph of a linear function
4. operators in c programming by digital wave
Factorizacion clase 1
Functions lect
Rational Function
4.2 vertex and intercept form
Dba matlab code
Ad

More from Innovative (6)

PPSX
Functions in c
PPSX
Addition of binary numbers
PPSX
Break and continue statement in C
PPSX
Pointers in C basics 01
PDF
Bitwise AND operator in c
PDF
Escape sequence in c part 1
Functions in c
Addition of binary numbers
Break and continue statement in C
Pointers in C basics 01
Bitwise AND operator in c
Escape sequence in c part 1
Ad

Recently uploaded (20)

PDF
International_Financial_Reporting_Standa.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Empowerment Technology for Senior High School Guide
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
20th Century Theater, Methods, History.pptx
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
HVAC Specification 2024 according to central public works department
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
International_Financial_Reporting_Standa.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
Hazard Identification & Risk Assessment .pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Introduction to pro and eukaryotes and differences.pptx
Empowerment Technology for Senior High School Guide
Practical Manual AGRO-233 Principles and Practices of Natural Farming
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
20th Century Theater, Methods, History.pptx
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Chinmaya Tiranga quiz Grand Finale.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
HVAC Specification 2024 according to central public works department
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Environmental Education MCQ BD2EE - Share Source.pdf

If control structure in c lnaguage

  • 1. Syntax of if control structure in C
  • 2. Relational Operators in C Operator Meaning Example Value of the expression < less than age < 30 > greater than height > 6.2 <= less than or equal to taxable <= 20000 Value is 0 (Zero) if expression is false >= greater than or equal to temperature >= 98.6 == equal to marks == 100 != not equal to number != 250 Value is 1 (one) if expression is True
  • 3. if(x<y) { ………. ………. } if(‘a’<‘P’) { ………. ………. } If x contains 5 and y contains 10 then value of the expression is 1 and condition is true If x contains 10 and y contains 4 then value of the expression is 0 and condition is false As ASCII value of A is 97 and ASCII value of P is 80 the expression is false and value of the expression is 0 If block
  • 4. if(-5) { ………. ………. } Valid condition. -5 is a truth value and is non zero. So value of the expression is 1 and statement is true! if(x) { ………. ………. } If x contains any non zero value the expression is true and value of the expression is 1. If x contains zero, value of the expression is 0 and statement is false