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]
4 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]4 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
can anyone yell how to save the python file in folder i am saving it but whenever I'm trying to open its not open​
NISA [10]

Saving a python file implies that one wants to have a physical file of the program on a storage device.

To save a python program, the following step must be followed

  1. Select Save As
  2. Navigate to the directory where you want to save the file
  3. Enter the file name
  4. Click save

Note that python files are saved in the .py extension

Read more about python programs at:

brainly.com/question/16397886

4 0
3 years ago
Read 2 more answers
Develop a Python application that incorporates using appropriate data types and provides program output in a logical manner. You
Rasek [7]

Answer:

#program in Python.

# create a dictionary

car_dic = dict()

# read brand of car

car_dic['brand'] = input("Enter brand : ")

#read model of cal

car_dic['model'] = input("Enter model : ")

#read manufactured year

car_dic['year'] = int(input("Enter manufactured year : "))

#starting odometer

car_dic['start_odometer'] = int(input("Enter the starting odometer reading: "))

#ending odometer

car_dic['end_odometer'] = int(input("Enter the ending odometer reading: "))

#mileage of the car

car_dic['mileage'] = float(input("Enter miles per gallon consumed by the vehicle: "))

#Details of the car

print("Details of the car: ")

for i in car_dic:

   print(i, ": ",car_dic[i])

Explanation:

Create a dictionary "car_dic" to store the Details of the car.Then ask user to enter the details of car such as brand, model, year, start_odometer, end_odometer and mileage.Then print all the details of the car.

Output:

Enter brand : Audi

Enter model : A6

Enter manufactured year : 2019

Enter the starting odometer reading: 100

Enter the ending odometer reading: 200

Enter miles per gallon consumed by the vehicle: 12

Details of the car:

mileage :  12.0

end_odometer :  200

year :  2019

model :  A6

start_odometer :  100

brand :  Audi

4 0
3 years ago
You will hear a series of activities typical of Candela's life. After listening to and repeating each one, rewrite the entire se
Anon25 [30]

These are the complete sentences using the correct forms of the verbs conjugated in the simple present tense:

  1. Nosotros escribimos correos electrónicos desde diferentes partes del mundo.
  2. Tus padres deben tener mucho dinero.
  3. Sus amigas asisten al gimnasio todos los días.
  4. Tú no comprendes a las otras abuelitas.
  5. Yo también vivo la vida loca.
<h3 /><h3>What is the simple present tense?</h3>

The Spanish simple present tense (''presente del indicativo'' in Spanish) is used to talk about habitual situations, routines, universal truths and facts.

All the verbs in the exercise are conjugated using this tense.

I was able to find the complete instructions for the exercise online. Here are the sentences that had to be changed:

  1. Candela escribe correos electrónicos desde diferentes partes del mundo. (Nosotros)
  2. Candela debe tener mucho dinero. (Tus padres)
  3. Candela asiste al gimnasio todos los días. (Sus amigas)
  4. Candela no comprende a las otras abuelitas. (Tú)
  5. Candela vive la vida loca. (Yo también)

Check more information about the simple present tense here brainly.com/question/26436711

6 0
3 years ago
If you are upgrading your operating system to Windows 7, you may not use the In-Place Upgrade Installation Option with
son4ous [18]
Windows Vista Premium
4 0
3 years ago
Write a program in c language to generate following series :
DedPeter [7]

In this exercise we have to have knowledge in computational language in C to write the requested code.

The code is found in the attached image.

We can write the code in a simpler way like:

<em>#include<stdio.h></em>

<em>#include<conio.h></em>

<em>int main()</em>

<em>{</em>

<em>    int N, i;</em>

<em>    printf("Enter the value of N (limit): ");</em>

<em>    scanf("%d", &N);</em>

<em>    printf("\n");</em>

<em>    for(i=1; i<=N; i++)</em>

<em>    {</em>

<em>        if(i==N)</em>

<em>            printf("%d", i);</em>

<em>        else</em>

<em>            printf("%d,", i);</em>

<em>    }</em>

<em>    getch();</em>

<em>    return 0;</em>

<em>}</em>

See more about C language at brainly.com/question/19705654

7 0
3 years ago
Read 2 more answers
Other questions:
  • Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
    9·2 answers
  • The part of the inside of a computer
    14·1 answer
  • Which of the following is false?
    7·1 answer
  • Jorge needs to print out an essay he wrote but he does not have a printer his neighbor has a printer, but her internet connectio
    12·1 answer
  • Which type of password would be considered secure
    13·2 answers
  • You recently created several new user accounts in the Sales OU and configured them with the appropriate group membership, logon
    12·1 answer
  • A user prefers an external monitor, mouse, and keyboard for a laptop. The user does not want to use the built-in screen; however
    5·1 answer
  • Which of the following are activities that today’s companies would perform?
    5·1 answer
  • The fill command try’s to fill or generate content for cells based on a ________.
    15·1 answer
  • The __________ operator increases the value of the variable by 1 after the original value is used in the expression in which the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!