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
gregori [183]
3 years ago
5

Consider the following code segment.

Computers and Technology
1 answer:
antiseptic1488 [7]3 years ago
6 0

Answer:

C. "Condition one" is printed once, and "Condition two" is printed twice.

Explanation:

Given

The above code segment

Required

The number of times each\ print\ statement is executed

For "Condition one" to be printed, the following conditions must be true:

if (col > 0) ---- the column must be greater than 0 i.e. column 1 and 2

if (arr[row][col] >= arr[row][col - 1]) --- the current element must be greater than the element in the previous column

Through the iteration of the array, the condition is met just once. When

row = 1  and   col = 2

arr[1][2] > arr[1][2-1]

arr[1][2] > arr[1][1]

4 > 3

For "Condition two" to be printed, the following condition must be true:

if (arr[row][col] % 2 == 0) ----array element must be even

Through the iteration of the array, the condition is met twice. When

row = 0  and   col = 1

row = 1  and   col = 0

arr[0][1] = 2

arr[1][0] = 4

You might be interested in
What is the proper order for the fetch-execute cycle?
vesna_86 [32]

Control Unit – controls all parts of the computer system. It manages the four basic operations of the Fetch Execute Cycle as follows:

Fetch – gets the next program command from the computer’s memory

Decode – deciphers what the program is telling the computer to do

Execute – carries out the requested action

Store – saves the results to a Register or Memory

Arithmetic Logic Unit (ALU) – performs arithmetic and logical operations

Register – saves the most frequently used instructions and data

5 0
3 years ago
How much are the prelab, inlab, and postlab parts worth?prelab:% inlab:%postlab%
Semmy [17]

Each lab consists of a PreLab, InLab, and a PostLab. PreLabs are worth 20%, InLab 50%, and PostLabs 30% of the final lab grade. the fifth submission is worth 40%.

<h3>What is prelab?</h3>
  • Pre-lab assignments are tasks or homework that students complete before arriving in class for the lab period.
  • Pre-lab assignments motivate students to prepare for the lab and help them connect conceptual understanding with an experiment.
<h3>What is inlab?</h3>
  • With inLab CAD Software, you design digital dentures and partial frameworks as well as splints, impression trays, and telescopes.
<h3>What is postlab?</h3>
  • Postlab is a Mac app that lets you collaborate on Final Cut Pro X libraries and Premiere Pro projects.
  • Postlab enables editors to share files, track and save changes, and make sure no more than one person is working on the same library or project simultaneously.

To learn more about it, refer

to brainly.com/question/22654163

#SPJ4

5 0
1 year ago
Which of the following statements regarding EFT is false? EFT still requires the endorsement of a check EFT allows payment to be
hammer [34]

A smart way of moving money from one personal banking account directly to another account is called EFT or electric fund transfer. There is a maximum clearance time of 24 hours for transfer.  The most widely-used program is Direct Deposit, in which payroll is deposited straight into an employee's bank account initiated through an electronic terminal, including credit card, Therefore, the following<span> statement regarding EFT is false?</span>

<span>1.                  </span><span>EFT still requires the endorsement of a check </span>

3 0
3 years ago
In this lab you will write a C program to sort an array of strings. The program will: Create an array of 50 strings; each string
andrezito [222]

Answer:

See explaination

Explanation:

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

void swap(char *arr[], int i, int minIdx)

{

char temp[30];

strcpy(temp, arr[i]);

strcpy(arr[i], arr[minIdx]);

strcpy(arr[minIdx], temp);

}

void sort(char *arr[], int n)

{

for (int i = 0; i < n - 1; i++)

{

int minIdx = i;

int minV = 10000;

char min[30];

strcpy(min, arr[i]);

for (int j = i + 1; j < n; j++)

{

int a = strcmp(min, arr[j]);

if (a < 0)

{

strcpy(min, arr[i]);

minIdx = j;

}

}

swap(arr, i, minIdx);

}

}

void print(char *arr[], int n)

{

for (int i = 0; i < n; i++)

printf("%s", arr[i]);

}

void read(char *arr[], int *n)

{

FILE *file = fopen("strings.dat", "r");

char line[30];

*n = 0;

printf("Reading from file...\n");

while (fgets(line, 30, file))

{

strcpy(arr[(*n)++], line);

}

print(arr, *n);

}

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

{

char *arr[50];

for (int i = 0; i < 50; i++)

arr[i] = (char *)malloc(sizeof(char) * 30);

int len;

int n = 0;

read(arr, &n);

printf("\n-------------------------\nAfter sorting\n");

sort(arr, n);

print(arr, n);

}

6 0
3 years ago
A determinant is any attribute whose value determines other values within a column.
guajiro [1.7K]

Answer:

true

Explanation:

4 0
3 years ago
Other questions:
  • Which of the case studies that you read (Walmart, Target or 5 Big Data Industries) caught your attention and why? Before reading
    11·1 answer
  • For your biology class, you will be giving a presentation of the findings of a plant growth experiment. Which application is bes
    7·1 answer
  • Computer Works is a computer accessories manufacturer based in Brazil. All customers in South America pay the same freight charg
    15·1 answer
  • What is UTF-8 and why was it created?
    8·1 answer
  • ________ refers to the ability to identify the person or entity with whom you are dealing on the Internet. Question 41 options:
    10·1 answer
  • Alex builds a 1 GHz processor where two important programs, A and B, take one second each to execute. Each program has a CPI of
    6·1 answer
  • Which of the following is true of a procedure? Check all that apply.
    10·2 answers
  • Pls help me computer science discoveries
    5·1 answer
  • Discuss the term internal control​
    12·1 answer
  • You just upgraded five computers with new, larger, hard drives. Now you would like to securely repurpose the old hard drives so
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!