answersLogoWhite

0


Best Answer

Bounded loops are also known as counting loops because they will iterate a pre-determined number of times before terminating. For example:

for x=1 to 15

print x

next x

Here, the variable x is incremented by 1 at the end of each iteration, thus the loop execute 15 times in total.

Unbounded loops are not defined by a specific count, but by some other condition. Unbounded loops are often called infinite loops, however there must always be an exit condition that is reachable.

x = rand()

while x<>0

print x

x = rand()

end while

Here, x is set to some random value. So long as x is non-zero, its value will print and x will be set to another random value. The loop may not execute at all (if x is initially zero), but once started it is not known how many times it will iterate until the exit condition is satisfied.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between bounded loop and unbounded loop in programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between bounded and unbounded transmission media?

v cv


What is the difference between bounded and unbounded media?

Bounded media are those that use cables for transmitting electricity or light; unbounded media does not require cabling and includes satellite, microwave and radio transmission. Wireless connections, including 802.11b and 802.11g, are examples of unbounded media. Today, bounded media continue to be more common than unbounded.


Is unit step signal is bounded or unbounded?

bounded signal


What is difference between infinite Bounded and infinite unbounded set?

A set of numbers is bounded if there exist two numbers x and y (with x &acirc;&permil;&curren; y)such that for every member of the set, x &acirc;&permil;&curren; a &acirc;&permil;&curren; y. A set is unbounded if one or both of x and y is infinite. Similar definitions apply for sets in more than 1 dimension.


Is the identity function bounded or unbounded?

That depends! The identity operator must map something from a space X to a space Y. This mapping might be continuous - which is the case if the identify operator is bounded - or discontinuous - if the identity operator is unbounded.


What is the difference between automatic buffering and explicit buffering?

Explicit buffering is also known as "Zero Capacity Buffering" where it has maximum length of 0. Automatic buffering can be either "Bounded Capacity Buffering" or "Unbounded Capacity Buffering"


Difference between automatic buffering and explicit buffering?

Explicit buffering is also known as "Zero Capacity Buffering" where it has maximum length of 0. Automatic buffering can be either "Bounded Capacity Buffering" or "Unbounded Capacity Buffering"


Is every continuous function is bounded in C?

No. y = 1/x is continuous but unbounded.


What is the difference between a mailboxes and message queue?

Mailbox is similar to a queue, which allows only atomic operations. They can be bounded/unbounded. Get/put task is used to suspend abounded mailbox. That?s why mailbox is used more for communication between threads. Queues are large structures. Inserting data in queues is very difficult


Is the graph of a solution set of a system of two linear inequalities always bounded?

No it is NOT always bounded. Here is an example of an unbounded one. 1. 2x-y&gt;-2 2. 4x+y


What is a bounded array?

A bounded array is an array data structure with a fixed size or capacity. It has a predetermined maximum number of elements that it can hold, and attempting to exceed this limit will result in an error or exception. This can be beneficial for memory management and preventing buffer overflows.


What is the difference exponential growth and decay?

They are incredibly different acceleration patterns. Exponential growth is unbounded, whereas exponential decay is bounded so as to form a "dynamic equilibrium." This is why exponential decay is so typical of natural processes. To see work I have done in explaining exponential decay, go to the page included in the related links.