/Dynamic_Memory_Allocation_Arrays_Pointers

These problems highlight the basic usage of arrays, pointers and structured programming.

Primary LanguageCGNU General Public License v3.0GPL-3.0

Problem 1

Write a program to find Largest Number Using Dynamic Memory Allocation from a list of elements. You have to input total size of elements and depending upon the number of elements, the required size has to be allocated using DMA. Example:

Input size of array: 5

Array element: 1 2 3 4 5

Expected Output: 5

Problem 2

Write a program to sort an array using Pointer. You have to write a function sortarray(int n, int * p) where n is the total array size and p is a pointer variable that have array address to solve the problem.

Input 5 number of elements in the array: 25 45 89 15 82

Expected Output: 15 25 45 82 89

Problem 3

Write a program that will delete all negative number by using Pointer. You have to declare a pointer array and dynamically allocate memory to input elements of array.

Problem 4

Write a program that will input student’s information (i.e. name, id, cgpa) who have enrolled for CSE-207 course in Summer 2020. You have to declare a pointer variable to input the information and dynamically allocate memory for storing information of each students. After taking input find out the student name who has obtained highest cgpa.