Question: Arrays X[2].Write a C function minInt() that takes an integer array and the number of elements in the array as parameters, finds and returns the

Arrays
X[2].Write a C function minInt() that takes an integer array and the number of elements in the array as parameters, finds and returns the minimum number in the array.
Prototype:int minInt(int ar[], int n);
X[2].Write a C function countPeaks() that takes an integer array and the number of elements in the array as parameters, finds and returns the number of peaks in the array. A peak is an element in the array which is greater than the preceeding number and the following number in the array.
Prototype:int countPeaks(int ar[], int n);
X[2].Write a function intersect() that takes five arguments: an array of integers, number of elements in this array, a second array of integers, number of elements in the second array, a third array as parameters; finds the numbers in the first array that also exist in the second array and places these numbers into the third array; returns the number of matching values stored in array-3.
Prototype:int intersect(int ar1[], int n1, int ar2[], int n2, int ar3[])
Strings
X[2].Write a C function countWords() that takes a string as parameter, finds and returns the number of word in the string. Word is a group of consecutive alphanumeric characters. "CS363" "C3PO".
Prototype:int countWords(char str[]);
X[2].Write a C function strUpper() that takes a string as parameter, and converts all lower case letters in the string to upper case.
Prototype:void strUpper(char str[]);
X[2].Write a C function strsShuffle() that takes three strings (say s1, s2, s3) as parameters, stores into s3 one character from s1 then one char from s2, then next char from s1, next char from 2, ... When all characters of s1 or s2 are used and there are more characters in the other string, then those characters are copied to s3. See examples below.
Example: if s1 is "ABCDEFGH", s2 is "1234", s3 will be "A1B2C3D4EFGH"
Example: if s1 is "ABCD", s2 is "123456", s3 will be "A1B2C3D456"
Prototype:void strsShuffle(char s1[], char s2[], char s3[]);
Pointers
X[2].Write a C function delWordN() that takes a string and an integer (n) as parameter, removes from the string the words that are n character long. A word is a group of consecutive alphanumeric characters; words are separated by non-alphanumeric characters.
Linked Lists
X[2].Write a function that changes the places of the first and second nodes of a linked list. I.e. First node will become second node, and the second node will become first node.
THE FUNCTION WILL NOT EXCHANGE DATA, IT WILL CHANGE LINKS.
Files
X[2].Write a C function readNums() that takes a filename and an integer array, reads the integer numbers in the file and stores into the array, returns the number of numbers stored in the array.
Assume that the file only contains integer numbers, and nothing else.
Prototype:int readNums(char filename[], int arr[]);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!