- How do you get the number of elements of an integer array?
- Is the size of a string array the same as the string length?
- What is the difference between a function declaration and a function definition?
- Can you have two functions with the same function name in a program?
- How does passing an integer array to a function differ from passing a single integer variable into a function?
- How can you make an array that is passed into a function not modifiable?
- What is the output of the following code segment:
#include <stdio.h> void func(int arr[], int size) { for (int i = 0; i < size; i++) arr[i] = arr[i] * 2; } int main() { int numbers[5] = {1, 2, 3, 4, 5}; func(numbers, 5); for (int i = 0; i < 5; i++) { printf("%d ", numbers[i]); } return 0; }
- What is the down-side to recursion?
- What happens if your recursive function does not have a base case?
- Write both the base case and the recursive case for the function
int sum_of_digits(int n)
that returns the sum of the digits of n (n>=0).