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
sweet-ann [11.9K]
3 years ago
11

Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:

Computers and Technology
1 answer:
bogdanovich [222]3 years ago
8 0

C Code:

#include <stdio.h>      // Enables use of printf

#include <stdlib.h>   // Enables use of rand()

#include <time.h>     // Enables use of time()

int main(void)

{

srand(time(0));  

int random1 = rand()% 50 + 100;

int random2 = rand()% 50 + 100;  

printf("%d\n", random1);

printf("%d\n", random2);

  return 0;

}

Output:

115

141

Explanation:

Each time program executes, srand() function generates new random numbers.

rand()%50 + 100 makes sure that number is 2 digit and within the range of 100 to 150.

Then we print the two random numbers where %d represents that we want to print an integer and \n represents new line  

You might be interested in
Which statement best describes the role of computing in entrepreneurship? Entrepreneurs can only be successful with modern compu
kykrilka [37]
Well according to e2020 the answer would be A. "Entrepreneurs can only be successful with modern computing technology."
5 0
3 years ago
Move the Retro music text object to the Album Title layer.​
Daniel [21]
If anyone say to “click this link for the explanation” do not click IT A VIRUS!!! be safe.
6 0
2 years ago
Which one is not considered part of the cinematography team?
wolverine [178]

sound recorder

Explanation:

i hope it works

4 0
2 years ago
Read 2 more answers
What is output by the following code?
Inessa05 [86]
When numbers are divided, the integer portion is kept and the remainder is disregarded (meaning 10/9 would return 1). Following this format, we get the answer of <span>6 6 6 3 7 7 9 5 8 8. 
I also see that this program can be optimized because you use the same for loop twice, and both of them manipulate list elements in some way. A more optimized program would be:

</span><span>int a [] = {64 , 66 , 67 , 37 , 73 , 70 , 95 , 52 , 81 , 82};

for (int i = 0; i < a.length; i++) {
  a[i] = a[i] / 10;
  </span>System.out.print(a[i] + " ");<span>
}

Or maybe you don't need to store the list values for later on. You could do:

</span>for (int i = 0; i < a.length; i++) {
  System.out.print(a[i] / 10 + " ");
}

In any situation, your answer is choice 2.
8 0
3 years ago
What was the computer works in binary functions
Mariulka [41]
Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit , is the smallest unit of data in computing.
7 0
2 years ago
Other questions:
  • In an office there is a unisex bathroom with n toilets. The bathroom is open to both men and women, but it cannot be used by men
    14·1 answer
  • A computer has a memory ________, rather than just a single memory component. The lowest level is some form of ________ storage
    11·1 answer
  • Which is a benefit of peer-to-peer networking?
    10·1 answer
  • What acronym describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrig
    9·1 answer
  • When a customer makes a request or complaint, the goal of customer service is to
    5·1 answer
  • Claire is trying to listen to her history professor's lecture, but her mind keeps wandering to thoughts about her plans for the
    5·1 answer
  • What is computer Network?​
    10·1 answer
  • American company Software Unlimited is planning to expand its operations to the Bangor Republic where the group is the primary u
    7·1 answer
  • What is the correct process for selecting an entire row in a spreadsheet?
    10·1 answer
  • Inheritance enables an object, called a _____, to derive one or more of its attributes from a parent.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!