EEGR-409, C Programming - Arrays,  Assignment #5

1.  Develop the following functions and develop a main to test them.  Use the *(a+n) format instead of a[n].

	void reverse_array(int *a, int *b, int num);
	// copies array a to array b and then reverses array b

	int is_palindromic(int *a, int num[]);
	// returns 1 if palindromic, 0 if not

	void sort_descending(int *a, int num_ele);

2.  Write a function to fetch a date from a user.

        void get_date(int *p_day, int *p_month, int *p_year);

3.  Write a function to convert a loop to a Thevinin Eq;

        void calc_thev(float v1, float r1, float r2, float *p_vth, float *p_rth);

4.  Develop and test functions to add, subtract, multiply, divide and parallel complex numbers.  Do not use structures.

    void c_conj(float a1, float b1, float *p_a2, float *p_b2);
    void c_add(float a1, float b1, float a2, float b2, float *p_a3, float *p_b3);
    void c_sub(float a1, float b1, float a2, float b2, float *p_a3, float *p_b3);
    void c_mul(float a1, float b1, float a2, float b2, float *p_a3, float *p_b3);
    void c_div(float a1, float b1, float a2, float b2, float *p_a3, float *p_b3);
    void c_para(float a1, float b1, float a2, float b2, float *p_a3, float *p_b3);

    Use these to evaluate the zeq of the following.


        -------------- 7 + j3 --------------
             |                     |        |
    zeq    1 - j2		          3 + j6  3 - j4
    ->       |                     |        |
        ------------------------------------

 5.  Develop a function that compares arrays of equal size and return a negative, positive or zero quantity.

     array_a < array_b   return neg value
     array_a == array_b  all elements match, return 0
     array_a > array_b   return pos value

     int compare_arrays (int *a, int *b, int num_ele);