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
miss Akunina [59]
3 years ago
15

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

Computers and Technology
1 answer:
blondinia [14]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   cout<< rand() % 50 + 100 <<endl;

   cout<<rand() % 50 + 100 <<endl;

   

   return 0;

}

Explanation:

The rand() gives you a random number. If you use rand() % 50, it will give you a random number between 0 and 49. Since we are required to have the numbers between 100 and 149, add 100 to this expression. This way, you will have a random number between 100 and 149. Type this expression two times and use "endl" to end with a new line.

You might be interested in
Given two Strings String s1 = "11223351638791377189728193"; String s2 = "983763978669976862724569282405742578"; and String varia
inn [45]

Answer:

import java.math.BigInteger;  

public class Main {  

public static void main(String[] args)  {  

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

BigInteger num1 = new BigInteger(s1);  

BigInteger num2 = new BigInteger(s2);  

BigInteger product = num1.multiply(num2);  

String s3 = product.toString(10);

System.out.println(s3);  

}  

}  

Explanation:

Because s1 and s2 contain large integers, the program need the biginteger module in other to compute the products of s1 and s2 when converted to integers.

This line initializes the two string variables s1 and s2

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

The next two lines convert the two strings to BigInteger. This allows the program to multiply large integers

<em> BigInteger a = new BigInteger(s1);   </em>

<em>BigInteger b = new BigInteger(s2);  </em>

<em />

This computes the product of the two big integers

BigInteger product = num1.multiply(num2);  

This converts the product to String s3

String s3 = product.toString(10);

This prints s3

System.out.println(s3);  

}  

}  

7 0
2 years ago
What is the purpose of the literature review section of research paper
navik [9.2K]

variation of colored sediment

5 0
3 years ago
Write c++ program to find maximum number for three variables using statement ?​
pantera1 [17]

Answer:

#include<iostream>

using namespace std;

int main(){

int n1, n2, n3;

cout<<"Enter any three numbers: ";

cin>>n1>>n2>>n3;

if(n1>=n2 && n1>=n3){

cout<<n1<<" is the maximum";}

else if(n2>=n1 && n2>=n3){

cout<<n2<<" is the maximum";}

else{

cout<<n3<<" is the maximum";}

return 0;

}

Explanation:

The program is written in C++ and to write this program, I assumed the three variables are integers. You can change from integer to double or float, if you wish.

This line declares n1, n2 and n3 as integers

int n1, n2, n3;

This line prompts user for three numbers

cout<<"Enter any three numbers: ";

This line gets user input for the three numbers

cin>>n1>>n2>>n3;

This if condition checks if n1 is the maximum and prints n1 as the maximum, if true

<em>if(n1>=n2 && n1>=n3){</em>

<em>cout<<n1<<" is the maximum";}</em>

This else if condition checks if n2 is the maximum and prints n2 as the maximum, if true

<em>else if(n2>=n1 && n2>=n3){</em>

<em>cout<<n2<<" is the maximum";}</em>

If the above conditions are false, then n3 is the maximum and this condition prints n3 as the maximum

<em>else{</em>

<em>cout<<n3<<" is the maximum";}</em>

return 0;

3 0
3 years ago
How do you make a ringtone on earsketch
RoseWind [281]

Haven't used earsketch, but here we go.

Answer:

1). Make a track in earsketch, make it like 6/7 seconds

2.) export your track as an .mp3, .wav, or  .ogg (your choice!)

3.) (If on android) Navigate to settings, now search for an entry for ringtone.

4.) If you have no luck, look up how to set ringtone on your desired phone brand (iOS, Android, etc.)

5.) Test out your new ringtone

6.)Profit

4 0
2 years ago
Which type of network attack uses a fake IP address to send data packets from an unauthorized user to a network?
liq [111]
D. DoS. DoS is a way to potentially lag or even crash different types of servers ranging from as small as a simple website to bigger websites and video games servers.
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
    5·1 answer
  • A word processing program would probably be used to: 
    8·1 answer
  • A nonpipelined system takes 300ns to process a task. The same task can be processed in a 5-segment pipeline with a clock cycle o
    10·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • How many bits would be needed to count all of the students in class today there is 20 students
    6·1 answer
  • Your mom wants to purchase a computer. She has heard about how the Windows 8 operating system is best-geared for a touch-enabled
    10·2 answers
  • Write a java program that would request user name, id number, and state the time the user has reported at work.​
    12·1 answer
  • Es costoso construir un robot
    6·1 answer
  • What distinguishes Accenture as a holistic provider of Extended Reality (XR) services?.
    9·1 answer
  • If a computer uses 500 characters, how many bits this system requires to give different code to all characters?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!