Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C program (50pts) Write a C program with no named packages that accepts one command line argument assumed to be a positive integer N. The
C program
(50pts) Write a C program with no named packages that accepts one command line argument assumed to be a positive integer N. The program should generate widths and heights (random integers between 5 and 100 inclusive) for some rectangles and print the widths and heights and areas for those rectangles whose area is greater than 2022. The program should stop generating the rectangles once N rectangles have been printed and finally report how many rectangles are discarded because their area is not greater than 2022. A sample run can look like the following you can check out the first for loop in the main function of the example program demo function_pointer.c to find out one possible way of generating a random integer in C. A sample run can look like the following: [kwang@computer) (-/temp] $ A3p2 4 Large random rectangle 1: width: 93; height: 19; area: 9207. Large random rectangle 2: width: 82; height: 78; area: 6396. Large random rectangle 3: width: 43; height: 91; area: 3913. Large random rectangle 4: width: 82; height: 50; area: 4100. Number of discarded small rectangles is 7 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