Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program that generates 100 random integer numbers in the range from 1 to 100 by calling rand function, and displays 10 numbers
Write a C program that generates 100 random integer numbers in the range from 1 to 100 by calling rand function, and displays 10 numbers in a row. The program then checks how many numbers are even numbers and how many are odd numbers. A function with the following function prototype is required to do the counting, and output the results on the screen, void counting even_numbers(int a[], int n); //where n represents the size of the array a. An example run of the program is as follows. The initial set of 100 numbers is: 55 89 5 7 56 53 87 62 36 15 6 67 88 49 83 89 67 52 912 60 48 7 47 7611 18 85 66 37 57 6 77 96 23 36 65 82 9063 63 92 41 87 95 42 28 53 41 98 70 37 70 75 81 73 60 44 61 3 33 4 37 36 49 24 10 44 80 34 8 4 29 4 77 3 24 48 22 7 27 10 35 89 78 30 24 69 27 27 There are 49 even numbers in the range from 1 to 100. There are 51 odd numbers in the range from 1 to 100
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started