Question: Write a C + + program to generate 1 0 random numbers in the range ( 3 0 to 5 5 ) . The program

Write a C++ program to generate 10 random numbers in the range (30 to 55).
The program needs to print the numbers. Then find and display:
how many of the generated numbers are even,
how many are odd and
how many are divisible by 7.
Note: use the statement: srand(time(NULL));
before the loop to change the seed of generating numbers each time.
Sample Input/Output:
The random numbers are:
49,47,325146,4340,31,3749
The number of evens is 3
The number of odds is 7
The numbers divisible by 7 are 2
 Write a C++ program to generate 10 random numbers in the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!