0% found this document useful (0 votes)
3 views6 pages

Display Numbers 1-10 Using Loops

The document outlines three different programming approaches to display numbers 1-10 on screen using loops: While Loop, Do While Loop, and For Loop. Each approach includes a problem definition, algorithm, flowchart, and mentions program coding and testing. Sample outputs are also referenced but not provided in detail.

Uploaded by

ninyahalim2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

Display Numbers 1-10 Using Loops

The document outlines three different programming approaches to display numbers 1-10 on screen using loops: While Loop, Do While Loop, and For Loop. Each approach includes a problem definition, algorithm, flowchart, and mentions program coding and testing. Sample outputs are also referenced but not provided in detail.

Uploaded by

ninyahalim2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Problem Definition

Create a program that displays 1-10 on screen, using While Loop pre-condition approach.

Algorithm:

Input: counter = 1

Loop: counter <= 10

Output: counter

Process: counter = counter + 1

Program Design

Flowchart

Start

counter = 1

False
counter <= 10 Stop

True

Print(counter)

counter = counter + 1
Program Coding

Program Testing & Debugging

Sample Output:
Problem Definition

Create a program that displays 1-10 on screen, using Do While Loop, post condition approach

Algorithm:

Input: counter = 1

Output: counter

Process: counter = counter + 1

Loop: counter <= 10

Program Design

Flowchart:

Start

counter = 1

Print(counter)

counter = counter + 1

True False
counter <= 10 Stop
Program Coding

Program Testing & Debugging

Sample Output:
Problem Definition

Create a program that displays 1-10 on screen, using For Loop pre-condition approach.

Algorithm:

Input: counter = 1

Loop: counter <= 10

Output: counter

Process: counter = counter + 1

Program Design

Flowchart

Start

counter = 1

counter <= 10 Stop

Print(counter)

counter = counter + 1
Program Coding

Program Testing & Debugging

Sample Output:

You might also like