1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
FinnZ [79.3K]
3 years ago
15

5. What are looping or interactive statements? which

Computers and Technology
1 answer:
tankabanditka [31]3 years ago
8 0
Looping statements are statements which execute one or more statements repeatedly a several number of times. Specifically when you need to execute a block of code in less time, less memory and etc, the looping concept is necessary.


Python provides many different ways for executing loops. While all the ways provide similar basic functionality, they differ in their syntax and condition checking time...

The while loop: used to execute a block of statements repeatedly until a given a condition is satisfied. (And when the condition becomes false, the line immediately after the loop in program is executed.)

The for loop: used for sequential traversal

(Includes)
- looping through a string
- Break statements
- Continue statements
- range() functions
- else statements
- nested loops


You might be interested in
Write the definition of a function reverse, whose first parameter is an array of integers and whose second parameter is the numb
GrogVix [38]

Answer:

The c++ function for reversing an array is given. The function is declared void since it returns no value.

void reverse( int arr[], int len )

{

   int temp[len];

   for( int k = 0; k < len; k++ )

   {

       temp[k] = arr[k];

   }

   for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

   {

           arr[k] = temp[j];

    }

}

Explanation:

The reverse function uses another array to reverse the elements of the original array.

An integer array is declared, temp[len], having the same length as the input array.

int temp[len];

To begin with, the elements of the input array are copied in the temp array.

for(int k = 0; k < len; k++ )

{

       temp[k] = arr[k];

}

Next, the elements of the input array are given new value.

The temp array, in reverse order, is copied into the input array.

for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

{

           arr[k] = temp[j];

}

The above for loop makes use of two variables simultaneously.

While the array, arr is proceeding from first element to the next, the array temp begins with the last element and goes down to the previous element.

Now, the input array, arr, contains the elements in reverse order.

The complete program is given.

#include <iostream>

using namespace std;  

 

void reverse( int arr[], int len );

void reverse( int arr[], int len )

{

   int temp[len];

   

   for(int k = 0; k < len; k++ )

   {

       temp[k] = arr[k];

   }

   

   for( int k = 0, j = len-1; k < len, j>= 0; k++, j-- )

   {

           arr[k] = temp[j];

   }

   

}

int main()  

{

   int len = 5;    

   int arri[len];    

   for( int l = 0; l < len; l++ )

   {

       arri[l] = l;

   }

   

   reverse( arri, len );    

   return 0;

}

8 0
3 years ago
I need help!!!! 1.04
Contact [7]
The answer could be all of the above
8 0
3 years ago
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? Ex
Delicious77 [7]

Answer: the employment demand would increase.

Explanation:

Several factors affect the employment demand especially in a field as peculiar as engineering, the cumulative build up of unemployed graduates and the skill set required to fit into the present working structure is also of Paramount importance. The evaluation method for recruitment seeks to function based on this rationale by selecting a few amongst many.

8 0
3 years ago
____ is the code of acceptable behaviors users should follow while on the internet; that is, it is the conduct expected of indiv
andriy [413]
The Computer Fraud and Abuse Act.
7 0
3 years ago
you just bought a new hard drive for your computer .you plan to use this as a secondary hard drive to store alll your files. wha
marin [14]
In case the first drive fails, the data will all be backed up onto the second drive, a copy will still be intact.
7 0
3 years ago
Other questions:
  • A DSLR camera is made up of two parts. They are
    13·2 answers
  • Write a Python program that reads the CSV file, compares the population estimates of every row for 2010 and 2017 and computes th
    10·1 answer
  • Convert 78 to binary
    6·2 answers
  • During detachment, _____.
    12·2 answers
  • The physical parts of the computer are known as?
    14·1 answer
  • Write a C++ function using recursion that returns the Greatest Common Divisor of two integers. The greatest common divisor (gcd)
    14·1 answer
  • In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each sear
    12·1 answer
  • Classify the various scenarios in a web development team that is creating a website for a client according to the priority level
    9·1 answer
  • Which of the following is a key aspect of any IT position? installation of fiber optic cables
    14·2 answers
  • Which statement is true of the digital sound produced by a computer using a<br> lower sample rate?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!