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
Zinaida [17]
3 years ago
7

Write a C program that does the following: Creates a 100-element array, either statically or dynamically Fills the array with ra

ndom integers between 1 and 100 inclusive Then, creates two more 100-element arrays, one holding odd values and the other holding even values (copied from the original array). These arrays might not be filled completely. Prints both of the new arrays to the console.
Computers and Technology
1 answer:
ANEK [815]3 years ago
5 0

Answer:

Following are the code to this question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

   int axb[100];//defining 1-array of 100 elements

   int odd_axb[100], even_axb[100];//defining two array that holds 100-elements

   int i,size=0,size1=0;

   for(i = 0; i < 100; i++)//defining for loop to assign value in array

   {

       axb[i] = rand() % 100 + 1;//using rand method to assign value with random numbers between 1 and 100

   }

   for(i = 0; i < 100; i++)//defining for loop that seprates array value in odd and even array

   {

       if(axb[i] % 2 == 0)//checking even condition  

       {

           even_axb[size++] = axb[i];//holding even number

       }

       else//else block

       {

           odd_axb[size1++] = axb[i];//holding Odd number

       }

   }

   //printing values

   cout << "Odd array: ";//print message  

   for(i = 0; i <size1; i++)//use for loop for print odd numbers

   {

   cout << odd_axb[i]<<" ";//printing values

   }

   

   cout <<"\n\n"<< "Even array: ";//print message

   for(i = 0; i <size; i++)//use for loop for print even_axb numbers

   {

       cout << even_axb[i] << " ";//printing values

   }

   return 0;

}

Output:

Odd array: 87 87 93 63 91 27 41 27 73 37 69 83 31 63 3 23 59 57 43 85 99 25 71 27 81 57 63 71 97 85 37 47 25 83 15 35 65 51 9 77 79 89 85 55 33 61 77 69 13 27 87 95  

Even array: 84 78 16 94 36 50 22 28 60 64 12 68 30 24 68 36 30 70 68 94 12 30 74 22 20 38 16 14 92 74 82 6 26 28 6 30 14 58 96 46 68 44 88 4 52 100 40 40

Explanation:

In the above-program, three arrays "axb, odd_axb, and even_axb" is defined, that holds 100 elements in each, in the next step, three integer variable "i, size, and size1" is defined, in which variable "i" used in the for a loop.

In the first for loop, a rand method is defined that holds 100 random numbers in the array, and in the next, for-loop a condition statement is used that separates even, odd number and store its respective array, and in the last for loop, it prints its store values  

You might be interested in
Lucy wants to access the webpage. She is using her computer to access the webpage. What types of information will be in one fram
ANTONII [103]

The types of information will be in one frame from Lucy’s computer as a sender until it gets to the webserver as a receiver is known to be her IP address and what she is searching for.

<h3>What is the network about?</h3>

In Communication using a webpage, it often start with a message, or what we call the information, that is known to be sent from one person or device to any other.

Note that in this exchange, there are three elements that are known to be in common which are :

  • The  message source, or sender.
  • The destination, or receiver, of the message.
  • The channel, made up of the transmission media.

Note that if a ‘message’ such as a file, image or video is known to be sent across a network, it is first  divided into small blocks known to be segments. These are known to be kept in containers known as packets, by the Internet Protocol (IP).

Hence, The types of information will be in one frame from Lucy’s computer as a sender until it gets to the webserver as a receiver is known to be her IP address and what she is searching for.

Learn more about webserver from

brainly.com/question/20818461

#SPJ1

6 0
2 years ago
Given the following code, what are the dimensions, in pixels, of the shape created? import tkinter class myShape: def __init__(s
S_A_V [24]

Answer:

Width: 145 px, Height: 145 px

Explanation:

To build a figure in Python with canvas, remember that drawing a rectangle is represented with self.canvas.create_rectangle(x1,y1,x2,y2), where x1,y1 are the  coordinates of the top left corner of the figure, and x2,y2, the coordinates of the bottom right corner.

Based on your data, the shape formed will not be a rectangle, but a square. The measures in x2, y2 are equal, so a square figure will form. For example, if you had (30,30,175,150) this would create a rectangle figure.

8 0
3 years ago
Radio waves can be used to transmit energy. What is an advantage of this method in computer technology
Law Incorporation [45]

Answer:

it allows that technology to be made wireless

Explanation:

The biggest advantage of radio waves for computer technology is that it allows that technology to be made wireless. Radio waves transmit energy, but these energy readings can be translated into binary code and used to send information from one device to another completely wirelessly. Meaning that you would not need any cables involved when trying to send the information. This is incredibly valuable and helpful in many situations such as sending photos or documents from one device to another.

5 0
3 years ago
Read 2 more answers
Victor has been murdered, and Art, Bob, and Carl are suspects. Art says he did not do it. He says that Bob was the victim's frie
professor190 [17]

20 characters yes no

7 0
3 years ago
As the network administrator for a growing company, you’re asked to solve a remote access dilemma. The 12 employees who work fro
Strike441 [17]

Answer:

To provide remote network access to the users to work, the network administrator can use virtual private network (VPN) along with some firewall to protect the system from hackers and other security threats.

Explanation:

Virtual Private Network (VPN) can be used to provide remote access to the users who are currently working from some remote areas. Many companies who have their branches or franchises in different parts of the city uses VPN to connect then all with the company server.

In this way, a firewall has been needed that protect the systems of users as well as company to protect from different security hazards such as hackers, authorization of the users and other security threats.

in this case, 12 em[employees who need remote access to the network can be connected through VPN along with the installation of some suitable firewall.

8 0
4 years ago
Other questions:
  • Given a string variable named sentence that has been initialized , write an expression whose value is the the very last characte
    14·1 answer
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, +
    11·1 answer
  • What are options in the Advanced tab in the Share Workbook dialog box? Check all that apply
    14·2 answers
  • Why is proper planning important?
    10·1 answer
  • A computer is presenting a user with a screen requesting payment before the user data is allowed to be accessed by the same user
    10·1 answer
  • Which function in the plane manager allows you to create a new plane where both x and y axes are perpendicular to the line selec
    14·1 answer
  • Which of the following statements best describes the relative amount of content held by digital libraries vs. the amount held by
    12·1 answer
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • If you convinced your teacher to give you an extension on an assignment, what would this situation be an example of? OA. General
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!