[SOLVED] ITDSIU19023- Fundamentals of Programming: Lab 03

25.00 $

Category:

Description

Rate this product

From this lab onward, create one single .c file and use functions for the questions (e.g. ex01, ex02, … for the function names)

  1. Input an array of n integers. Write a function to check whether the array is symmetric or not (optional: use recursive)

Example: 1 2 3 2 1 à symmetric

  1. Input an array of n integers. Sort the odd numbers in increasing order and even numbers in decreasing order

Example: array = 2 5 3 4 8 6 7 9 2 à result = 8 3 5 6 4 2 7 9 2

 

  1. Input an array of n integers. Find the largest sorted sub array (sorted array increasing/decreasing and has the largest number of elements)

Example: array = 2 5 3 4 8 9 7 6 10 à result = 3 4 8 or 9 7 6

  1. Write a function to check whether a given array is sorted or not. Return 1 if sorted increasing, -1: decreasing, 0: not sorted
  2. Write a function to move all positive element of an array upfront

Example: 2 -3 4 6 -7 9 8 -2 à 2 4 6 9 8 -3 -7 -2