السلام عليكم ورحمة الله وبركاته
لو سمحتوا بغيت حل لهذا السؤال:-
QUOTE]Write a C++ program that performs the following:
(a) Your program should generate two random numbers. The first number is between 0 and 99 and the
second number between 0 and 29. The C++ function rand() generates random numbers between 0
and RAND MAX (its default value is implementation defined, for example, RAND MAX in Microsoft
Visual C++ is 32767). Generate random numbers using srand with time as a seed.
(B) Once the two integers have been generated randomly; your program should call one function that adds the two numbers, another function that subtracts them, and a third function to multiply the sum and difference. The sequence of calls must be as follows:
main calls the sum function passing the two numbers as parameters.
sum invokes the subtract function by passing three parameters, the two numbers and sum, then
subtract calls the product function by passing two parameters, the sum and difference of the two integers.
sum and subtract should return a value of type integer. product should return a value of float type. Also, subtract should calculate the square root of the returned product.
Here is a sample of an input/output
The Maximum positive random that can be generated on Microsoft Visual C++ is: 32767
The first generated random number between 0 and 99 is: 80
The second generated random number between 0 and 29 is: 23
The sum is: 103
The diff is: 57
The prod is: 5871
Square root of the product is: 76.62