C Programming. Assignment #5, Arrays & structures

1.  Develop the following functions and develop a main to test them.

	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_array(int a[], int num_ele);
              //  sorts array in ascending order

2.  Consider a structure of the form;

typedef struct
{
   float num;
   float denom;
} FRACT;

Develop functions to multiply, divide and add fractions.

	FRACT mul_f(FRACT a, FRACT b);
	FRACT div_f(FRACT a, FRACT b);
	FRACT add_f(FRACT a, FRACT b);

3.  Consider a structure of the form;

typedef struct
{
     float root1;
     float root2;
} ROOTS;

Develop a function to solve a quadratic equation;

  	ROOTS solve_eq(float a, float b, float c);


4.  Repeat the above using ROOTS and COEFFS;

typedef struct
{
     float root1;
     float root2;
} ROOTS;

typedef struct
{
     float a;
     float b;
     float c;
} COEFFS;

Develop a function to solve a quadratic equation;

  	ROOTS solve_eq(COEFFS v);