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...

  • C language program Write a program to do the following tasks. Generate x random integers, the...

    C language program Write a program to do the following tasks. Generate x random integers, the values of which are in the range [2, y]. The values of x and y are decided by the user, and both no larger than 100. Calculate and print the number of times each integer in [2, y] occurred in these x random integers. For example, suppose x=9, y=6 and the generated random integers are 4, 4, 3, 6, 4, 4, 3, 2, 6...

  • 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 *...

  • CODE MUST BE IN C 1. Given an int variable n that has been initialized to...

    CODE MUST BE IN C 1. Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alreadybeen declared, use a while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and...

  • 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...

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