SlideShare a Scribd company logo
1 of 35
Handling
Input/output
&
Control StatementsCourse: Diploma
Subject: Computer Fundamental & Programming In C
CONTROL STATEMENTS
 C language supports the following statements known
as control or decision making statements.
1. if statement
2. switch statement
3. conditional operator statement
4. Go to statement
IF STATEMENT
 The if statement is used to control the flow of
execution of statements and is of the form
 If(test expression)
 Eg:
if(bank balance is zero)
Borrow money
Cont..
 The if statement may be implemented in different
forms depending on the complexity of conditions
to be tested.
1. Simple if statement
2. if…..else statement
3. Nested if…..else statement
4. elseif ladder
The general form of a simple
if statement is The
‘statement-block’ may be a
single statement or a group
of statement
If(test exprn)
{
statement-block;
}
statement-x;
Cont..
THE IF…ELSE STATEMENT
 The if….else statement is an extension of simple if
statement. The general form is
If(test expression)
{
True-block statement(s)
}
else
{
False-block statement(s)
}
statement-x
Cont..
 If the test expression is true, then the true block statements
are executed; otherwise the false block statement will be
executed.
Cont..
 Eg:
………
………
if(code ==1)
boy = boy + 1;
if(code == 2)
girl =girl + 1;
………
………
NESTING OF IF…..ELSE STATEMENTS
 When a series of decisions are involved, we may have
to use more than one if….else statements, in nested
form as follows
Cont..
Here, if the condition 1 is false then it
skipped to statement 3.
But if the condition 1 is true, then it
tests condition 2.

If condition 2 is true then it executes
statement 1 and if false then it executes
statement 2.
 Then the control is transferred to the
statement x.
This can also be shown by the following
flowchart,
Program
/*Selecting the largest of three values*/
main()
{
float A, B, C;
printf(“Enter three values n”);
scanf(“|%f %f %f”,&A, &B, &C);
printf(“nLargest value is:”);
if(A > B)
{ if(A > C)
printf(“%f n”,A);
else
printf(“%f n”,C);
}
else
{
if(C > B)
printf(“%f n”,C);
else
printf(“%f n”,B);
}
}
 OUTPUT
 Enter three values:
 5 8 24
 Largest value is 24
The else if ladder
When a multipath decision is involved then we use else if ladder.
 A multipath decision is a chain of ifs in which the statement associated
with each else is an if.
It takes the following general form,
Cont..
 This construct is known as the else if ladder. The conditions are
evaluated from the top, downwards. This can be shown by the
following flowchart
THE SWITCH STATEMENT
 Switch statement is used for complex programs when
the number of alternatives increases.
 The switch statement tests the value of the given
variable against the list of case values and when a
match is found, a block of statements associated with
that case is executed.
SWITCH STATEMENT
 The general form of switch statement is
switch(expression)
{
case value-1:
block-1
break;
case value-2:
block-2
break;
…….
…….
default:
default-block
break;
}
statement-x;
Example:
index = marks / 10;
switch(index)
{
case 10:
case 9:
case 8:
grade = “Honours”;
break;
case 7:
case 6:
grade = “first division”;
break;
case 5:
grade = “second
division”;
break;
case 4:
grade = “third
division”;
break;
default:
grade = “first
division”; break
}
printf(“%s n”,grade);
………….
THE ?: OPERATOR
 The C language has an unusual operator, useful for making two-
way decisions.
 This operator is a combination of ? and : and takes three
operands.
 It is of the form exp1?exp2:exp 3
 Here exp1 is evaluated first. If it is true then the expression exp2 is
evaluated and becomes the value of the expression.
 If exp1 is false then exp3 is evaluated and its value becomes the
value of the expression.
Eg:
if(x < 0)
flag = 0;
else
flag = 1;
can be written as
flag = (x < 0)? 0 : 1;
UNCONDITIONAL STATEMENTS - THE GOTO STATEMENT
C supports the goto statement to
branchunconditionally from one point of the
program to another.
The goto requires a label in order to identify
the place where the branch is to be made.
A label is any valid variable name and
must be followed by a colon.
DECISION MAKING AND LOOPING
 In looping, a sequence of statements are executed until some
conditions for termination of the loop are satisfied.
 In looping, a sequence of statements are executed until some
conditions for termination of the loop are satisfied.
 A program loop therefore consists of two segments, one known
as the body of the loop and the other known as the control
statements.
Cont..
Depending on the position of the control statements in
the loop, a control structure may be classified either as an
entry-controlled loop or as the exit-controlled loop.
Loops In C
 The C language provides for three loop constructs for
performing loop operations.
 They are:
The while statement
The do statement
The for statement
THE WHILE STATEMENT
 The basic format of the while statement is
while(test condition)
{
body of the loop
}
 The while is an entry–controlled loop statement.
 The test-condition is evaluated and if the condition is true, then the
body of the loop is executed.
 After execution of the body, the test-condition is once again evaluated and
if it is true, the body is executed once again.
 This process of repeated execution of the body continues until the test-
condition finally becomes false and the control is transferred out of the loop.
Example of WHILE Loop
-----------
-----------
Body of the loop
test
condn?
while(test condition)
{
body of the loop
}
sum = 0;
n = 1;
while(n <= 10)
{
sum = sum + n* n;
n = n + 1;
}
printf(“sum = %d n”,sum);
-----------
-----------
THE DO STATEMENT
 In while loop the body of the loop may not be executed at
all if the condition is not satisfied at the very first attempt.
 Such situations can be handled with the help of the do
statement.
do
{
body of the loop
}
while(test condition);
Cont..
 Since the test-condition is evaluated at the bottom of the loop,
the do…..while construct provides an exit-controlled loop and
therefore the body of the loop is always executed at least once.
Eg:
-----------
do
{
printf(“Input a numbern”);
number = getnum();
}
while(number > 0);
-----------
THE FOR STATEMENT
 The for loop is another entry-controlled loop that
provides a more concise loop control structure
 The general form of the for loop is
for(initialization ; test-condition ; increment
{
body of the loop
}
Cont..
 The execution of the for statement is as follows:
 Initialization of the control variables is done first.
 The value of the control variable is tested using the test-condition.
 If the condition is true, the body of the loop is executed; otherwise
the loop is terminated and the execution continues with the
statement that immediately follows the loop.
 When the body of the loop is executed, the control is transferred
back to the for statement after evaluating the last statement in
the loop.
 Now, the control variable is either incremented or decremented as
per the condition.
For Statement
 Eg 1)
for(x = 0; x <= 9; x = x + 1)
{
printf)”%d”,x);
}
printf(“n”);
 The multiple arguments in the increment section are possible
and separated by commas.
Cont..
 Eg 2)
sum = 0;
for(i = 1; i < 20 && sum <100; ++i)
{
sum =sum + i;
printf(“%d %d n”,sum);
}
for(initialization ; test-condition ; increment
{
body of the loop
}
Nesting of For Loops
 C allows one for statement within another for
statement.
Cont..
 Eg:
 ----------
 ----------
 for(row = 1; row <= ROWMAX; ++row)
 {
 for(column = 1; column < = COLMAX; ++column)
 {
 y = row * column;
 printf(“%4d”, y);
 }
 printf(“n”);
 }
 ----------
 ----------
JUMPS IN LOOPS
 C permits a jump from one statement to another within a
loop as well as the jump outof a loop.
Jumping out of a Loop
 An early exit from a loop can be accomplished by using the
break statement or the goto statement.
 When the break statement is encountered inside a loop, the
loop is immediately exited and the program continues with
the statement immediately following the loop.
 When the loops are nested, the break would only exit from
the loop containing it. That is, the break will exit only a
single loop.
Skipping a part of a Loop
 Like the break statement, C supports another similar
statement called the continue statement.
 However, unlike the break which causes the loop to be
terminated, the continue, as the name implies, causes the
loop to be continued with the next iteration after skipping
any statements in between.
 The continue statement tells the compiler, “SKIP THE
FOLLOWING STATEMENTS AND CONTINUE WITH THE NEXT
ITERATION”.
 The format of the continue statement is simply
continue;
Bypassing and continuing I Loops
References
1. http://www.computer-books.us/c_0008.php
2. http://www.computer-books.us/c_0009
3. http://www.computer-books.us/c_2.php
4. www.tutorialspoint.com/cprogramming/cprogramming_pdf.
5. Programming in C by yashwant kanitkar
6. ANSI C by E.balagurusamy- TMG publication
7. Computer programming and Utilization by sanjay shah Mahajan Publication
8. www.cprogramming.com/books.html

More Related Content

What's hot

Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJTANUJ ⠀
 
Control structure C++
Control structure C++Control structure C++
Control structure C++Anil Kumar
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C pptMANJUTRIPATHI7
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming FundamentalsKIU
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C ProgrammingKamal Acharya
 
COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops Hemantha Kulathilake
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statementsrajshreemuthiah
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYRajeshkumar Reddy
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__elseeShikshak
 
The Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsThe Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsTech
 

What's hot (20)

Unit 5. Control Statement
Unit 5. Control StatementUnit 5. Control Statement
Unit 5. Control Statement
 
Flow of control C ++ By TANUJ
Flow of control C ++ By TANUJFlow of control C ++ By TANUJ
Flow of control C ++ By TANUJ
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
Controls & Loops in C
Controls & Loops in C Controls & Loops in C
Controls & Loops in C
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C Programming
 
Control statement in c
Control statement in cControl statement in c
Control statement in c
 
COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops COM1407: Program Control Structures – Repetition and Loops
COM1407: Program Control Structures – Repetition and Loops
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statements
 
Control statements
Control statementsControl statements
Control statements
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
 
Flow of control
Flow of controlFlow of control
Flow of control
 
Control statments in c
Control statments in cControl statments in c
Control statments in c
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__else
 
Flow of control ppt
Flow of control pptFlow of control ppt
Flow of control ppt
 
The Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming ConceptsThe Three Basic Selection Structures in C++ Programming Concepts
The Three Basic Selection Structures in C++ Programming Concepts
 

Viewers also liked

Mba ewis ii u i process view of organization
Mba ewis ii u i process view of organizationMba ewis ii u i process view of organization
Mba ewis ii u i process view of organizationRai University
 
Updated b.tech ii unit i conjunctions
Updated b.tech ii unit i conjunctionsUpdated b.tech ii unit i conjunctions
Updated b.tech ii unit i conjunctionsRai University
 
Bsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareBsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareRai University
 
Bdft i, hcr, unit-ii, fashion in different period
Bdft i, hcr, unit-ii, fashion in different periodBdft i, hcr, unit-ii, fashion in different period
Bdft i, hcr, unit-ii, fashion in different periodRai University
 
Updated b.tech ii unit ii idioms
Updated b.tech ii unit ii idiomsUpdated b.tech ii unit ii idioms
Updated b.tech ii unit ii idiomsRai University
 
Llb i bpoc u 2.2 consideration
Llb i bpoc u 2.2 considerationLlb i bpoc u 2.2 consideration
Llb i bpoc u 2.2 considerationRai University
 
Bdft i, def,unit-i, elements of design,
Bdft i, def,unit-i,  elements of design,Bdft i, def,unit-i,  elements of design,
Bdft i, def,unit-i, elements of design,Rai University
 
B.sc. agri i pog unit 2 mutation
B.sc. agri i pog unit 2 mutationB.sc. agri i pog unit 2 mutation
B.sc. agri i pog unit 2 mutationRai University
 
Bba i ecls_u-3_reading & comprehension
Bba i ecls_u-3_reading & comprehensionBba i ecls_u-3_reading & comprehension
Bba i ecls_u-3_reading & comprehensionRai University
 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Rai University
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionRai University
 
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding Rai University
 
B.sc. agri i pog unit 4 population genetics
B.sc. agri i pog unit 4 population geneticsB.sc. agri i pog unit 4 population genetics
B.sc. agri i pog unit 4 population geneticsRai University
 
Llb ii pil u 3.1 sources of interntional law
Llb ii pil u 3.1 sources of interntional lawLlb ii pil u 3.1 sources of interntional law
Llb ii pil u 3.1 sources of interntional lawRai University
 
B.sc agriculture i principles of plant pathology u 5.2 nematodes
B.sc agriculture i principles of plant pathology u 5.2  nematodesB.sc agriculture i principles of plant pathology u 5.2  nematodes
B.sc agriculture i principles of plant pathology u 5.2 nematodesRai University
 
Mba ii hrm u-2.2 job analysis
Mba ii hrm u-2.2 job analysisMba ii hrm u-2.2 job analysis
Mba ii hrm u-2.2 job analysisRai University
 
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...Rai University
 

Viewers also liked (18)

Mba ewis ii u i process view of organization
Mba ewis ii u i process view of organizationMba ewis ii u i process view of organization
Mba ewis ii u i process view of organization
 
Updated b.tech ii unit i conjunctions
Updated b.tech ii unit i conjunctionsUpdated b.tech ii unit i conjunctions
Updated b.tech ii unit i conjunctions
 
Bsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareBsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system software
 
Bdft i, hcr, unit-ii, fashion in different period
Bdft i, hcr, unit-ii, fashion in different periodBdft i, hcr, unit-ii, fashion in different period
Bdft i, hcr, unit-ii, fashion in different period
 
Updated b.tech ii unit ii idioms
Updated b.tech ii unit ii idiomsUpdated b.tech ii unit ii idioms
Updated b.tech ii unit ii idioms
 
Llb i bpoc u 2.2 consideration
Llb i bpoc u 2.2 considerationLlb i bpoc u 2.2 consideration
Llb i bpoc u 2.2 consideration
 
Mba ewis ii u i tqm
Mba ewis ii  u i tqmMba ewis ii  u i tqm
Mba ewis ii u i tqm
 
Bdft i, def,unit-i, elements of design,
Bdft i, def,unit-i,  elements of design,Bdft i, def,unit-i,  elements of design,
Bdft i, def,unit-i, elements of design,
 
B.sc. agri i pog unit 2 mutation
B.sc. agri i pog unit 2 mutationB.sc. agri i pog unit 2 mutation
B.sc. agri i pog unit 2 mutation
 
Bba i ecls_u-3_reading & comprehension
Bba i ecls_u-3_reading & comprehensionBba i ecls_u-3_reading & comprehension
Bba i ecls_u-3_reading & comprehension
 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3
 
Mca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroductionMca 2 sem u-1 iintroduction
Mca 2 sem u-1 iintroduction
 
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding
Diploma_I_Applied science(chemistry)U_I Atoms,molecules and bonding
 
B.sc. agri i pog unit 4 population genetics
B.sc. agri i pog unit 4 population geneticsB.sc. agri i pog unit 4 population genetics
B.sc. agri i pog unit 4 population genetics
 
Llb ii pil u 3.1 sources of interntional law
Llb ii pil u 3.1 sources of interntional lawLlb ii pil u 3.1 sources of interntional law
Llb ii pil u 3.1 sources of interntional law
 
B.sc agriculture i principles of plant pathology u 5.2 nematodes
B.sc agriculture i principles of plant pathology u 5.2  nematodesB.sc agriculture i principles of plant pathology u 5.2  nematodes
B.sc agriculture i principles of plant pathology u 5.2 nematodes
 
Mba ii hrm u-2.2 job analysis
Mba ii hrm u-2.2 job analysisMba ii hrm u-2.2 job analysis
Mba ii hrm u-2.2 job analysis
 
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...
B.sc agriculture i principles of plant pathology u 2 symptoms, signs and iden...
 

Similar to Diploma ii cfpc u-3 handling input output and control statements

handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statementsRai University
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, LoopingMURALIDHAR R
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptxSKUP1
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptxLECO9
 
2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.pptManojKhadilkar1
 
Module 2- Control Structures
Module 2- Control StructuresModule 2- Control Structures
Module 2- Control Structuresnikshaikh786
 
C++ decision making
C++ decision makingC++ decision making
C++ decision makingZohaib Ahmed
 
Control statements anil
Control statements anilControl statements anil
Control statements anilAnil Dutt
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 
Looping Statement And Flow Chart
 Looping Statement And Flow Chart Looping Statement And Flow Chart
Looping Statement And Flow ChartRahul Sahu
 
Programming Fundamentals in C++ structures
Programming Fundamentals in  C++ structuresProgramming Fundamentals in  C++ structures
Programming Fundamentals in C++ structuresayshasafdarwaada
 
Control Statement IN C.pptx
Control Statement IN C.pptxControl Statement IN C.pptx
Control Statement IN C.pptxsujatha629799
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in JavaNiloy Saha
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements Tarun Sharma
 
Programming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsProgramming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsLovelitJose
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c languagetanmaymodi4
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguageTanmay Modi
 

Similar to Diploma ii cfpc u-3 handling input output and control statements (20)

handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statements
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, Looping
 
Comp ppt (1)
Comp ppt (1)Comp ppt (1)
Comp ppt (1)
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptx
 
C-Programming Control statements.pptx
C-Programming Control statements.pptxC-Programming Control statements.pptx
C-Programming Control statements.pptx
 
2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt2. Control structures with for while and do while.ppt
2. Control structures with for while and do while.ppt
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Module 2- Control Structures
Module 2- Control StructuresModule 2- Control Structures
Module 2- Control Structures
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
C++ decision making
C++ decision makingC++ decision making
C++ decision making
 
Control statements anil
Control statements anilControl statements anil
Control statements anil
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
Looping Statement And Flow Chart
 Looping Statement And Flow Chart Looping Statement And Flow Chart
Looping Statement And Flow Chart
 
Programming Fundamentals in C++ structures
Programming Fundamentals in  C++ structuresProgramming Fundamentals in  C++ structures
Programming Fundamentals in C++ structures
 
Control Statement IN C.pptx
Control Statement IN C.pptxControl Statement IN C.pptx
Control Statement IN C.pptx
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
 
Programming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-ExpressionsProgramming in java - Concepts- Operators- Control statements-Expressions
Programming in java - Concepts- Operators- Control statements-Expressions
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguage
 

More from Rai University

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University Rai University
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,Rai University
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02Rai University
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditureRai University
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public financeRai University
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introductionRai University
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflationRai University
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economicsRai University
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructureRai University
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competitionRai University
 

More from Rai University (20)

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University
 
Mm unit 4point2
Mm unit 4point2Mm unit 4point2
Mm unit 4point2
 
Mm unit 4point1
Mm unit 4point1Mm unit 4point1
Mm unit 4point1
 
Mm unit 4point3
Mm unit 4point3Mm unit 4point3
Mm unit 4point3
 
Mm unit 3point2
Mm unit 3point2Mm unit 3point2
Mm unit 3point2
 
Mm unit 3point1
Mm unit 3point1Mm unit 3point1
Mm unit 3point1
 
Mm unit 2point2
Mm unit 2point2Mm unit 2point2
Mm unit 2point2
 
Mm unit 2 point 1
Mm unit 2 point 1Mm unit 2 point 1
Mm unit 2 point 1
 
Mm unit 1point3
Mm unit 1point3Mm unit 1point3
Mm unit 1point3
 
Mm unit 1point2
Mm unit 1point2Mm unit 1point2
Mm unit 1point2
 
Mm unit 1point1
Mm unit 1point1Mm unit 1point1
Mm unit 1point1
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditure
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public finance
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introduction
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflation
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economics
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructure
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competition
 

Recently uploaded

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Recently uploaded (20)

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 

Diploma ii cfpc u-3 handling input output and control statements

  • 2. CONTROL STATEMENTS  C language supports the following statements known as control or decision making statements. 1. if statement 2. switch statement 3. conditional operator statement 4. Go to statement
  • 3. IF STATEMENT  The if statement is used to control the flow of execution of statements and is of the form  If(test expression)  Eg: if(bank balance is zero) Borrow money
  • 4. Cont..  The if statement may be implemented in different forms depending on the complexity of conditions to be tested. 1. Simple if statement 2. if…..else statement 3. Nested if…..else statement 4. elseif ladder
  • 5. The general form of a simple if statement is The ‘statement-block’ may be a single statement or a group of statement If(test exprn) { statement-block; } statement-x; Cont..
  • 6. THE IF…ELSE STATEMENT  The if….else statement is an extension of simple if statement. The general form is If(test expression) { True-block statement(s) } else { False-block statement(s) } statement-x
  • 7. Cont..  If the test expression is true, then the true block statements are executed; otherwise the false block statement will be executed.
  • 8. Cont..  Eg: ……… ……… if(code ==1) boy = boy + 1; if(code == 2) girl =girl + 1; ……… ………
  • 9. NESTING OF IF…..ELSE STATEMENTS  When a series of decisions are involved, we may have to use more than one if….else statements, in nested form as follows
  • 10. Cont.. Here, if the condition 1 is false then it skipped to statement 3. But if the condition 1 is true, then it tests condition 2.  If condition 2 is true then it executes statement 1 and if false then it executes statement 2.  Then the control is transferred to the statement x. This can also be shown by the following flowchart,
  • 11. Program /*Selecting the largest of three values*/ main() { float A, B, C; printf(“Enter three values n”); scanf(“|%f %f %f”,&A, &B, &C); printf(“nLargest value is:”); if(A > B) { if(A > C) printf(“%f n”,A); else printf(“%f n”,C); } else { if(C > B) printf(“%f n”,C); else printf(“%f n”,B); } }  OUTPUT  Enter three values:  5 8 24  Largest value is 24
  • 12. The else if ladder When a multipath decision is involved then we use else if ladder.  A multipath decision is a chain of ifs in which the statement associated with each else is an if. It takes the following general form,
  • 13. Cont..  This construct is known as the else if ladder. The conditions are evaluated from the top, downwards. This can be shown by the following flowchart
  • 14. THE SWITCH STATEMENT  Switch statement is used for complex programs when the number of alternatives increases.  The switch statement tests the value of the given variable against the list of case values and when a match is found, a block of statements associated with that case is executed.
  • 15. SWITCH STATEMENT  The general form of switch statement is switch(expression) { case value-1: block-1 break; case value-2: block-2 break; ……. ……. default: default-block break; } statement-x;
  • 16. Example: index = marks / 10; switch(index) { case 10: case 9: case 8: grade = “Honours”; break; case 7: case 6: grade = “first division”; break; case 5: grade = “second division”; break; case 4: grade = “third division”; break; default: grade = “first division”; break } printf(“%s n”,grade); ………….
  • 17. THE ?: OPERATOR  The C language has an unusual operator, useful for making two- way decisions.  This operator is a combination of ? and : and takes three operands.  It is of the form exp1?exp2:exp 3  Here exp1 is evaluated first. If it is true then the expression exp2 is evaluated and becomes the value of the expression.  If exp1 is false then exp3 is evaluated and its value becomes the value of the expression. Eg: if(x < 0) flag = 0; else flag = 1; can be written as flag = (x < 0)? 0 : 1;
  • 18. UNCONDITIONAL STATEMENTS - THE GOTO STATEMENT C supports the goto statement to branchunconditionally from one point of the program to another. The goto requires a label in order to identify the place where the branch is to be made. A label is any valid variable name and must be followed by a colon.
  • 19. DECISION MAKING AND LOOPING  In looping, a sequence of statements are executed until some conditions for termination of the loop are satisfied.  In looping, a sequence of statements are executed until some conditions for termination of the loop are satisfied.  A program loop therefore consists of two segments, one known as the body of the loop and the other known as the control statements.
  • 20. Cont.. Depending on the position of the control statements in the loop, a control structure may be classified either as an entry-controlled loop or as the exit-controlled loop.
  • 21. Loops In C  The C language provides for three loop constructs for performing loop operations.  They are: The while statement The do statement The for statement
  • 22. THE WHILE STATEMENT  The basic format of the while statement is while(test condition) { body of the loop }  The while is an entry–controlled loop statement.  The test-condition is evaluated and if the condition is true, then the body of the loop is executed.  After execution of the body, the test-condition is once again evaluated and if it is true, the body is executed once again.  This process of repeated execution of the body continues until the test- condition finally becomes false and the control is transferred out of the loop.
  • 23. Example of WHILE Loop ----------- ----------- Body of the loop test condn? while(test condition) { body of the loop } sum = 0; n = 1; while(n <= 10) { sum = sum + n* n; n = n + 1; } printf(“sum = %d n”,sum); ----------- -----------
  • 24. THE DO STATEMENT  In while loop the body of the loop may not be executed at all if the condition is not satisfied at the very first attempt.  Such situations can be handled with the help of the do statement. do { body of the loop } while(test condition);
  • 25. Cont..  Since the test-condition is evaluated at the bottom of the loop, the do…..while construct provides an exit-controlled loop and therefore the body of the loop is always executed at least once. Eg: ----------- do { printf(“Input a numbern”); number = getnum(); } while(number > 0); -----------
  • 26. THE FOR STATEMENT  The for loop is another entry-controlled loop that provides a more concise loop control structure  The general form of the for loop is for(initialization ; test-condition ; increment { body of the loop }
  • 27. Cont..  The execution of the for statement is as follows:  Initialization of the control variables is done first.  The value of the control variable is tested using the test-condition.  If the condition is true, the body of the loop is executed; otherwise the loop is terminated and the execution continues with the statement that immediately follows the loop.  When the body of the loop is executed, the control is transferred back to the for statement after evaluating the last statement in the loop.  Now, the control variable is either incremented or decremented as per the condition.
  • 28. For Statement  Eg 1) for(x = 0; x <= 9; x = x + 1) { printf)”%d”,x); } printf(“n”);  The multiple arguments in the increment section are possible and separated by commas.
  • 29. Cont..  Eg 2) sum = 0; for(i = 1; i < 20 && sum <100; ++i) { sum =sum + i; printf(“%d %d n”,sum); } for(initialization ; test-condition ; increment { body of the loop }
  • 30. Nesting of For Loops  C allows one for statement within another for statement.
  • 31. Cont..  Eg:  ----------  ----------  for(row = 1; row <= ROWMAX; ++row)  {  for(column = 1; column < = COLMAX; ++column)  {  y = row * column;  printf(“%4d”, y);  }  printf(“n”);  }  ----------  ----------
  • 32. JUMPS IN LOOPS  C permits a jump from one statement to another within a loop as well as the jump outof a loop. Jumping out of a Loop  An early exit from a loop can be accomplished by using the break statement or the goto statement.  When the break statement is encountered inside a loop, the loop is immediately exited and the program continues with the statement immediately following the loop.  When the loops are nested, the break would only exit from the loop containing it. That is, the break will exit only a single loop.
  • 33. Skipping a part of a Loop  Like the break statement, C supports another similar statement called the continue statement.  However, unlike the break which causes the loop to be terminated, the continue, as the name implies, causes the loop to be continued with the next iteration after skipping any statements in between.  The continue statement tells the compiler, “SKIP THE FOLLOWING STATEMENTS AND CONTINUE WITH THE NEXT ITERATION”.  The format of the continue statement is simply continue;
  • 35. References 1. http://www.computer-books.us/c_0008.php 2. http://www.computer-books.us/c_0009 3. http://www.computer-books.us/c_2.php 4. www.tutorialspoint.com/cprogramming/cprogramming_pdf. 5. Programming in C by yashwant kanitkar 6. ANSI C by E.balagurusamy- TMG publication 7. Computer programming and Utilization by sanjay shah Mahajan Publication 8. www.cprogramming.com/books.html