USING C LANGUAGE write a program that swaps the values of two identically sized
ID: 3759987 • Letter: U
Question
USING C LANGUAGE
write a program that swaps the values of two identically sized arrays by doing
the following:
1)create a function that swaps the values of two integer arrays. Use pointer
arithmetic to access the array elements.
Parameters:
- an integer array, *passed by reference*
- a second integer array, *passed by reference*
- the number of elements to swap
return value: none
2)create a function that prints the values of an integer array. Each element and
the address of each element in the array should be printed. Use pointer
arithmetic to access the array elements.
Parameters:
- an integer array, *passed by reference*
- the number of elements to print
return value: none
3)Create a function that asks the user to enter a series of integers. Use pointer
arithemetic to access the array elements.
Parameters:
- an integer array, *passed by reference*
- the number of elements to read in.
return value: none
thank you :)
Explanation / Answer
void SquareByAddress(int * ptr) // Note that this function doesn't return anything. void function. { *ptr = (*ptr) * (*ptr); // modifying the target, *ptr } int main() { int num = 4; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.