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
babunello [35]
3 years ago
14

How many times will the following loop display "Looping again!"? for(int i=0; i<=20; i++) cout << "Looping again!" <

< endl;
Computers and Technology
1 answer:
kotegsom [21]3 years ago
4 0

Answer:

21 times

Explanation:

Following are the description of output:

  • As it is for loop and The loop is started from the i=0 , after that check the condition 0<=20 condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • Now i=1  1<=20  condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • i=2 2<=20 condition is true .The control moves to the body of loop and it print Looping again! on the console window .After that it increment the value of i=i+1 .
  • ............soon
  • This process is executed again and again but when the value i=21 the loop condition is false .The loop is terminated .
  • As the loop is starts from the i=0 and executed less then equal to 20 therefore 21 times the loop is executed .
You might be interested in
What is computer and its features<br>​
dlinn [17]

Answer:

A computer is a machine that can be programmed to manipulate symbols.

Explanation:

Following are the features of PC (computer)

Processor  

speed  

reliability  

accuracy  

automation  

diligence  

consistency    

Random access memory (RAM)  

Operating system  

Graphics adapter and video RAM  

Monitor

3 0
4 years ago
Read 2 more answers
How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which start
Alexus [3.1K]

Answer:

Explanation:

260 cost units, Big O(n) complexity for a push

6 0
3 years ago
Implement a program to measure the impact of application-level buffer sizes on read time. This involves writing to and reading f
Luda [366]

Answer:

Input file: input.txt

Output file: output.txt

input.txt is a text file of 500 MB.

CODE:

#include <stdio.h>

#include <time.h>

#include <stdlib.h>

#include <fcntl.h>

#include <sys/time.h>

#include <string.h>

#include <unistd.h>

#include <sys/types.h>

double count = 0; // to keep the count of writes

// function which reads from input.txt and writes to output.txt

void fun(int* file_in, int* file_out, int BUFF_SIZE)

{

char *buff = (char *)malloc(BUFF_SIZE*sizeof(char));

while(read(*file_in, buff, BUFF_SIZE) != 0)

{

write(*file_out, buff, strlen(buff));

count++;

}

}

int main(int argc, char* argv[])

{

if(argc == 1)

{

printf("Usage: ./program.c [ buff_size(in bytes) ]\n");

return 0;

}

int file_in,file_out; // input and output file pointers

file_in = open("input.txt",O_RDONLY);

if(file_in == -1)

{

printf("Error while open input.txt \n");

return 0;

}

file_out = open("output.txt",O_WRONLY);

if(file_out == -1)

{

printf("Error occured while opening output.txt\n");

return 0;

}

struct timeval t1, t2; // for capture time

double elapsedTime;

// start timer

gettimeofday(&t1, NULL);

// do something

// ...

fun(&file_in, &file_out, atoi(argv[1]));

// stop timer

gettimeofday(&t2, NULL);

// compute and print the elapsed time in millisec

elapsedTime = (t2.tv_sec - t1.tv_sec)*1000.0; // sec to ms

printf("Overall write time: %lf ms\n",elapsedTime);

printf("Per write time: %lf ms\n", elapsedTime/count);

return 0;

Explanation:

Please see attachment for output

6 0
4 years ago
Each wireless network has its own name to identify it, known as service set identity. true false
Dominik [7]
True. The acronym for service set identity is SSID, which you've likely saw before. And like you say, it's simply the unique name given to a wireless network so that we are able to identify what network we are connecting to.
8 0
3 years ago
When inputting a formula into excel or other spreadsheet software, what components are required for the formula to function prop
Ilia_Sergeevich [38]

The components  required for the formula to function properly are equal sign, function name , argument and parenthesis.

<h3> </h3>

<h3>What is a function?</h3>

A function is an established formula which when provided with specific values  performs calculations.

Some spreadsheet functions include

  • sum
  • average
  • count
  • maximum value
  • minimum value

In order for a formulae to work correctly, a function must be written a with the basic syntax components which includes:

  • an equals sign (=) to start the formulae,
  • the function name (AVERAGE , for example),
  • Arguments B1:B9
  • Closing parentheses to close opening parentheses.()

For example =AVERAGE(B1:B9)

Read more on writing about spreadsheet software formula  functions :brainly.com/question/26364021

7 0
3 years ago
Other questions:
  • What file format is best for photo editing? Select one: a. JPG b. RAW c. DOC d. RTF
    12·2 answers
  • What is a sign that content is
    8·2 answers
  • Suppose two computers (A &amp; B) are directly connected through Ethernet cable. A is sending data to B, Sketch the waveform pro
    9·1 answer
  • A slow response when opening applications or browsing the Internet, applications that do not work properly, an operating system
    5·2 answers
  • What is the current in a circuit that uses 120V and has 1200W of power?
    6·1 answer
  • Define a class Complex to represent complex numbers. All complex numbers are of the form x + yi, where x and y are real numbers,
    10·1 answer
  • Which of the following is true of binary files?
    6·2 answers
  • Cómo se hacían antes las cosas que hoy en día se hacen apoyadas en aplicaciones y software?
    10·1 answer
  • Write the following program: Use struct data type to store information about courses. Every course is characterized by the follo
    6·1 answer
  • 1. It manages the computer's memory and processes, as well as all of its software and hardware.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!