+ 1
For this i need to write?
display the quality of random number having value between 1 to 50 and the number having values greater than 50.
23 Respostas
+ 1
You are welcome ☺️
+ 4
Look I still didn't get what you want but here is the array
int randomNum[30];
for (int i=0;i<30;i++)
randomNum[i] =rand() %50;
And here is the random number between 50 and 100
int randomNum50=(rand() +50)%100;
+ 2
Can you explain what's the meaning of quality
And I will tell you how
+ 2
For random number is rand() function, if you want number <= 50
you need to write rand() % 50;
👍
+ 1
But in front of this is
Fill an array of 30 integer number with random number that have be scaled to the range 1 to 100.
+ 1
What is the meaning fo the back .
display the quality of random number having value between 1 to 50 and the number having values greater than 50.
+ 1
The Question ask the code to generate 30 random numbers where the value is between 1 - 100.
Then count how many values are 1-50 and how many values are more than 50.
Let's say we have 10 numbers : 25, 16, 86, 53, 46, 28, 77, 90, 11, 12
Quantity of 1-50 : 6 values ---> 25, 16, 46, 28, 11, 12
Quantity of >50 : 4 values ---> 86, 53, 77, 90
+ 1
Now I get it
But you typed quality in the question not quantity
+ 1
I will give it to you its easy
+ 1
Oh , sorry about that
+ 1
Ok, thank you~
+ 1
I write my code until here only
#include <iostream>
using namespace std;
int main()
{
int randomNumber;
for (int index = 0; index <30; index++)
{
randomNumber = (rand() % 100) ;
cout << randomNumber << endl;
}
}
+ 1
For this QUESTION need to use function
0
Function for what?
0
For this code owo
0
😂😂😂
I know but what the function will do in that question?
0
Ya
0
Is the code OK?
Or you want some edits?
0
I think is ok already ,thank you so much ❤