you use loops to draw out information from an array or a vector. Also they can be used to count up or down from any giving number.
#include <iostream>
using namespace std;
int main()
{
short a = 1;
short b = 1;
short c = 2;
//do
while (a && b && c != 34);
{
a = c + b;
cout << a << "\n";
b = a + c;
cout << b << "\n";
c = b + a;
cout << c << "\n";
}//while (a && b && c != 34);
return 0;
}
the output of this program would be
3
5
8
13
21
34
if i was to rewrite this program with out the loop, i would have to write the body of the loop
a = c + b;
cout << a << "\n";
b = a + c;
cout << b << "\n";
c = b + a;
cout << c << "\n";
over and over again until i reached the number 34. its adding 1 + 1 = 2
2+1=3, 3+2=5 and so on, that's how the program is reaching 34.
Give a business example of how loops can be beneficial in a program?
We use this in order to make program easier and less complex.some program cannot be performed without loops
Reason is very similar as Fruity Loops, its a better program and takes a little more time to master
Loops are used to repeat the execution of the same set of instructions again and again in a program.
Whenever there is a repetition in the program.
With loops, your program is slower.
You can use zero or more while-loops, there is no limit.
frutie loops it is a great program
Cleaning out the loops is essentially removing redundant lines of code in a program. Sometimes having too many of the same codes can slow the program down and cause it to not work as efficiently.
Shoulder loops signify what program the scouts or scouters are in, or if they work at district, council, section, region, or national level.
I guess they are references to a program list or a figure.
The word 'beneficial' is an adjective, a word that describes a noun. Example use:This is a beneficial program for our department.