Question: Write a C program that converts each number in an array by the sum of that number plus 6 modulus 10. A sample input/output: Enter
Write a C program that converts each number in an array by the sum of that number plus 6 modulus 10. A sample input/output:
Enter the length of the array: 5
Enter the elements of the array: 3 928 4 14 77
Output: 9 4 0 0 3
The program should include the following function:
void convert(int *a1, int n, int *a2)
The function converts every element in array a1 of length n to an output array a2.
The function should use pointer arithmetic (instead of array subscripting). In other words, eliminate the loop index variables and all use of the [] operator in the function.
1)The program will read in the number of element of the array, for example, 4, then read in the numbers in the array, for example, 3 16 81 9.
2)In the main function, declare the input array after reading in the number of element of the array, then read in the elements, and declare the output array, then call the convert function. The main function should display the converted array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
