REPETITION FROM PPSC AS PER JNTUK KKD.pptx

MastanaihnaiduYasam 2 views 45 slides Mar 04, 2025
Slide 1
Slide 1 of 45
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45

About This Presentation

We must design a Loop, so that before or after each iteration, it checks to see if the task is done. If it in not done, the loop repeats one more time;if task is done,the loop terminates. This test is known as Loop Control Expression.


Slide Content

REPETITION

Concept of Loop We must design a Loop, so that before or after each iteration, it checks to see if the task is done. If it in not done, the loop repeats one more time;if task is done,the loop terminates. This test is known as Loop Control Expression.

PRETEST AND POST TEST LOOPS

Initialization may be Implicit or Explicit. Implicit -No direct initialization of code, depends on pre-existing situation Explicit -we include code to set the beginning values of key loop variables. Infinite Loop if condition is not happened Loop updates INITIALIZATION AND UPDATING

INITIALIZATION AND UPDATING

Example

EVENT AND COUNTER CONTROLLED LOOPS Event C ontrolled Loop: Event changes the control expression from true to false

Counter controlled Loop: we know the number of time that the loop is repeated EVENT AND COUNTER CONTROLLED LOOPS

LOOP COMPARISONS

LOOPS IN C

while Statement

Compound while Statement

Process Controlled System Loop

for Loop

Compound for Loop

Comparing for and while Loops

Comparing for and while Loops- Example

do-while Statement

The Comma Expression

LOOP STATEMENTS - EXAMPLES

for Loops- Example

while Loops- Example

OTHER STATEMENTS RELATED TO LOOPING break

OTHER STATEMENTS RELATED TO LOOPING continue

LOOPING APPLICATIONS Summation & Product Powers Smallest and Largest Inquiries-any or all

Summation & Product

Summation- Example

Powers-Example

Smallest and Largest

Inquiries- any or all

Inquiries- any

Inquiries- all

PROGRAMMING EXAMPLE- THE CALCULATOR PROGRAM Addition, Subtraction, Division, Multiplication and Quit.

See program in pdf
Tags