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
Which task is not possible with VLOOKUP?
Flauer [41]

Answer:c

Explanation:

4 0
3 years ago
Read 2 more answers
SecOps focuses on integrating the need for the development team to provide iterative and rapid improvements to system functional
IRINA_888 [86]

Answer: (B) <em>False</em>

Explanation:

SecOps also known as the Security Operations is referred to as a collaborative or combined effort between Information Technology security and the operations teams that tend to integrate technology, tools, and processes in order to meet the collective aim goals and aim of keeping an organization and enterprise secure while on the other hand reducing risk and also improving organizations agility.

5 0
3 years ago
Why was the first computer developed? a.) for personal use, b.) for military purposes, c.) for transportation, d.) for communica
IgorLugansk [536]
B) For Military Purposes but around the 1970s they became widely available to consumers.
5 0
3 years ago
What are three consequences of a negative digital Trail​
Vladimir79 [104]

Answer:

The digital footprint that is had behind can have repercussions in every aspect of your adolescent's life, conceivably bringing about botched occupation chances, public sharing of individual data, destroyed connections

Explanation:

Digital trail what's left behind as you calmly peruse the web, post via web-based media or even sort into a visit administration. Regardless of whether you're mindful, you add to your advanced impression or profile every day when you sign onto the Internet. The sites you visit, the news posts you remark on, the remarks you leave via web-based media stages—every one of these things meet up to make a representation of your online life.  

The digital footprint that is had behind can have repercussions in every aspect of your adolescent's life, conceivably bringing about botched occupation chances, public sharing of individual data, destroyed connections — or, in what is likely more pertinent to them at this moment: Their folks discovering what they've been up to and along these lines being rebuffed.

8 0
2 years ago
According to the video, which of the following is communication between two individuals? Intrapersonal Communication Public Spea
DedPeter [7]

Answer:

The Last option: Dyadic Communication AND Interpersonal Communication

is the correct one.

Explanation:

Communication can be defined as the process in which one may convey his thoughts or inquires about things.

There are many types of communications as listed above.

  • Intrapersonal Communication
  • Interpersonal Communication
  • Dyadic Communication
  • Small Group Communication
  • Public Communication
  • Mass Communication
  • Organizational Communication
  • Intercultural Communication.

Under all these, Interpersonal communication and Dyadic communication are the ones that are between two people.

Dyadic communication is the one in which two people relate to exchange thoughts and ideas face-to-face. It is sometimes referred as dialogic relation.

Interpersonal relation can be between two or more than  two persons that may know each other. It is clearly specified in this communication that who listener and speaker are.

<h3>I hope it will help you!</h3>
3 0
2 years ago
Read 2 more answers
Other questions:
  • Assume that printStars is a function that takes one argument and returns no value. It prints a line of N stars (followed by a ne
    13·1 answer
  • To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuat
    8·2 answers
  • True or false? when intel places a sticker on computers showing their chip is inside, they are demonstrating their visible value
    7·1 answer
  • How can i learn about networks
    15·1 answer
  • The MAA is responsible on a daily basis to protect office computers and patient records and personal information from hackers. R
    12·1 answer
  • ) A popular PivotChart that is used in Access is (Points : 4) column.
    9·1 answer
  • Eugene wants to indent a paragraph, but the ruler is not present. Which tabs could Eugene use in order to accomplish his goal?
    14·1 answer
  • knowledge contributes vitally to the development of __________ memory, or recollections of personally experienced events that oc
    12·1 answer
  • If i keep giving out brainlyest will i get banned again?
    12·2 answers
  • You will include code that will validate all user input. If the user inputs an invalid value, the program will respond with an e
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!