ECE 175: Computer Programming for Engineering Applications Spring 2016 Lab Assignment #5 Problem 1: Write a C program that generates complex random numbers in [-1,1] (for both the real and imaginary components) using the rand() function and RAND_MAX definition that are in the math.h library. Prompt the user to enter a number of random complex numbers that your program will generate. For each complex that you generate calculate the magnitude. Count the complex numbers that have a magnitude less than 1. Print out the fraction of number numbers generated that magnitude less than 1. Your program should have the following prototypes:
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |