Question: Using C Programming and #include Question 1 David and Peter are twins. Not only do they have the same outlook, they always have the same

 Using C Programming and #include Question 1 David and Peter aretwins. Not only do they have the same outlook, they always havethe same exact height and weight. If David's height (int h) is

Using C Programming and #include

Question 1 David and Peter are twins. Not only do they have the same outlook, they always have the same exact height and weight. If David's height (int h) is 180cm and weight (int w) is 65kg, represent Peter's height and weight using pointers int *hPtr and int *WPtr. Write a C program to input David's height and weight and print the values for h, w, hPtr and WPtr. David's height: 180cm Weight: 65kg Peter's height: 180cm Weight: 65kg Question 2 Complete the C program below to print all values of the number array using an integer pointer int *numberPtr. int main (void) { int number [10] int *numberPtr; {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // Insert your code here return 0; } Question 3 Modify the function cube () below to accept an integer pointer nPtr as input parameter and return void. int cube (int n) { return n *n* n; } int main (void) { int number 5; number cube (number); printf("%d", number); return 0; } Question 4 Write a function named mystrcat() to concatenate two string pointers char *strl and char *str2 and return char *str. Note: DO NOT USE strcat() from library. Extend your program with a function named convertToUppercase () to accept a character pointer char *sPtr and change all letters in the string to uppercase. Question 5 Rewrite the following using a recursive function countingUp (int n) to print from the number 1 to a given number, n, in ascending order. void countingup (int n) { for (int i 1; i 0, baseexp = base * base Now, modify your recursive function above to use the following formulas: Formulas: if exp = 0, basexp = 1 if exp > 0 and exp is odd, basexp = base * basexp-1 if exp> 0 and exp is even, baseomp = (base?)exp/2

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!