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
Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 the output is
Misha Larkins [42]

Answer:

The program to this question can be given as:

Program:

def swap_values(user_val1, user_val2):  #define function

   return (user_val2, user_val1) #return values

if __name__ == '__main__': #define constructor.

   n1 = int(input('Enter first number :')) #input value form user

   n2 = int(input('Enter second number :')) #input value form user

   (n1,n2) = swap_values(n1,n2) #hold function values.

   print(n1) #print values

   print(n2) #print values

Output:

Enter first number :3

Enter second number :8

8

3

Explanation:

The explanation of the above python program can be given as:

  • In the python program we define a function that is "swap_values". This function takes two integer values that is "user_val1 and user_val2" as a parameters and returns variable values that is "user_val2 and user_val1".
  • Then we use a constructor in this we define two variable that is "n1 and n2" these variable are use to take user-input from the user and pass the value into the function.  
  • To hold the value of the function we use n1 and n2 variable and print these variable value.
4 0
3 years ago
Versiones del Moodle
SIZIF [17.4K]

Answer:

Moodle 3.1 (LTS), Moodle 3.1, Moodle 3.1.1, Moodle 3.1.2, Moodle 3.1.3, Moodle3.1.4

4 0
3 years ago
Knowledge and experience help you
Zarrin [17]

Answer:

yes it can it shows u what you did wrong or what you did right

Explanation:

brainlet me please

8 0
3 years ago
An electronic résumé is a plain-looking document. Please select the best answer from the choices provided T F
a_sh-v [17]

Answer:

True

Explanation:

You will find that an electronic resume is an ASCII or plain text, HTML or PDF document which gives an employer the information related to the candidates for his job posting like education, professional experience, job qualification, and it is meant to be operated by a computer program rather than a certain human being. And hence, the above statement is true.

5 0
3 years ago
Read 2 more answers
5. What skill is unique to reading online?
torisob [31]
Ignoring distractions like hyperlinks and advertisements
6 0
3 years ago
Other questions:
  • If you wanna buy a Monitor, please explain why you wanna buy it! PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!
    9·1 answer
  • You have just built a new system from scratch. you turn the computer on but the system boot fails and sounds a beep code. what m
    15·1 answer
  • Within the information category of functions, you will find functions that ____.
    7·2 answers
  • Role of computers in everyday life​
    15·1 answer
  • What is NOT a built-in function in python?<br> sqrt()<br> string()<br> fabs()<br> O print()
    12·2 answers
  • What are the primary IP addresses for DNS servers hosted on the x128bit, iskytap and cloudparadox domains
    8·1 answer
  • Write a for loop to print all the even numbers from 200 to 300.
    14·1 answer
  • Declare a struct of your choice (Employee, Student etc). Delcare a node for singly link list. Declare an ADT of this linklist. T
    7·1 answer
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    5·1 answer
  • Explain employment opportunities in the networking field 
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!