Question

Code has already been provided to generate two random integers with values between 0 and 10 that are assigned to the variable

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

X=randi([1,10]);
Y=randi([1,10]);
XandY=['The value of X is ' num2str(X) ', and the value of Y is ' num2str(Y) '.']
XplusY=['The sum of X and Y is ' num2str(X+Y) '.']

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Code has already been provided to generate two random integers with values between 0 and 10...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a MATLAB code to generate an array of 100 random integers between 1 and 10...

    Write a MATLAB code to generate an array of 100 random integers between 1 and 10 using the command “randi”. Using “if” statement, impose the condition that if a number in the array is greater than 5, the number is modified as, number = number – 11. Find the sum of the array and store it. Repeat this exercise for 10, 1000 and 100000 trials and plot the following: (a) Sums obtained vs trails number (b) Histogram of the sum...

  • 4.60 The sum of two uniform random numbers. Generate two random numbers between 0 and 1...

    4.60 The sum of two uniform random numbers. Generate two random numbers between 0 and 1 and take Y to be their sum. Then Y is a continuous random variable that can take any value between 0 and 2. The density curve of Y is the triangle shown in Figure 4.12. (a) Verify by geometry that the area under this curve is 1. (b) What is the probability that Y is less than 1? [Sketch the density curve, shade the...

  • Generate two random numbers between 0 and 1 and take X to be their sum. The...

    Generate two random numbers between 0 and 1 and take X to be their sum. The sum X can take any value between 0 and 2. The density curve of X is the triangle in the figure. Height 1 0

  • Part 2 -Arrays We can use the Math.random method to generate random integers. For example, Math.r...

    Please write a JAVA program according to following requirement. Thanks Part 2 -Arrays We can use the Math.random method to generate random integers. For example, Math.random () generates a random integer greater than or equal to 0 and less than 1. The expression Math. random) 6generates random numbers between 0 and 5, simulating the throw of a die. In this lab assignment, you will use an array to test whether the random generator is fair; that is, whether each possible...

  • programming language Write a program that will generate 5 random numbers between 20 and 80 and...

    programming language Write a program that will generate 5 random numbers between 20 and 80 and assign each to a variable of datatype double. You should use a random number generator seeded with time Using a series of if statements, determine which of the 5 variables contains the smallest value generated Print all five random numbers to the screen and print out the value that you determined was the smallest. All values should be printed with zero decimal places. 2.

  • Three C Code Questions: 5. Write a C program that declares an array of 10 strings,...

    Three C Code Questions: 5. Write a C program that declares an array of 10 strings, each of max length 50 characters, and then reads an entire line of text from the keyboard into each string. 6. Write C code that finds the longest name in this array of strings that you read in Q5. Hint: find the position of the longest string, not the string itself. 7. Write a C program that creates a 4 x 6 two dimensional...

  • This program will use the Random class to generate random temperatures (integers) between some minimum (inclusive)...

    This program will use the Random class to generate random temperatures (integers) between some minimum (inclusive) and some maximum (inclusive) values. You will need to calculate the minimum and maximum given a starting temperature integer and a possible change in temperature integer. (1) Copy the following method stub into your Temperature Predictor class and complete it according to the specifications described in the header comments. * Generates a random temperature (int) within a range when given the current temperature *...

  • GLOBAL A Mare out of bodo Question 2 Hagestion Write a C++ program to generate two...

    GLOBAL A Mare out of bodo Question 2 Hagestion Write a C++ program to generate two random integers x and y in the range 10 to 40 such that x <y. The program should prompt the user to choose from the following menu: (8 points) 1. Calculate and output the percentage of perfect numbers between 1 and x (10 points) 2. Calculate and output the average of odd divisors of x. (8 points) 3. Calculate and output the value of...

  • USE Python 1. Assign value 555 to the variable x, write code to square the variable...

    USE Python 1. Assign value 555 to the variable x, write code to square the variable x and print out the result. 2. Given a string x, write a program to check if its first character is the same as its last character. If yes, the code should output "True" . 3. We defined two variables, x = 'Python' and y = '3.0'. Write code to concatenate the two numbers (the result should be 'Python3.0').

  • Consider the following code: int w- 10; while (w>0) scanf("%d", &y); if(y>0){ V++i else The value...

    Consider the following code: int w- 10; while (w>0) scanf("%d", &y); if(y>0){ V++i else The value stored in variable v at the end of the execution of the loop could best be described as the sum of all positive numbers scanned from the terminal the number of times the loop executed the sum of all non-positive numbers scanned from the terminal the number of positive integers scanned from the terminal the number of negative integers scanned from the terminal

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT