Question: C + + Writing a program to create a single source code file that uses pointer variables and functions. write a program that reads 2
CWriting a program to create a single source code file that uses pointer variables and functions.
write a program that reads integers from the user and calls different functions to do the following:
void swapArgsint int function that takes pointers to integers and swaps the integers read in main
void divideArgsint int function that takes pointers to integers and stores the integer quotient in the first pointer parameter and the remainder in the second pointer parameter.
void powerArgsint int function that takes pointers to integers, raises the first integer to the power of the second integer, and stores the result in the first integer. You may NOT use the pow function to do this, you must use a loop to calculate the result. Recall, any number raised to the power is If the power is a negative number, do not calculate any result. See sample runs below.
sample run:
Enter integer :
Enter integer :
Before call to swapArgs a: b:
After call to swapArgs a: b:
After call to divideArgs a: b:
After call to powerArgs a: b:
Goodbye!
Enter integer :
Enter integer :
Before call to swapArgs a: b:
After call to swapArgs a: b:
After call to divideArgs a: b:
After call to powerArgs a: b:
Goodbye!
Enter integer :
Enter integer :
Before call to swapArgs a: b:
After call to swapArgs a: b:
After call to divideArgs a: b:
After call to powerArgs a: b:
Goodbye!
Enter integer :
Enter integer :
No operations performed!
Enter integer :
Enter integer :
Before call to swapArgs a: b:
After call to swapArgs a: b:
After call to divideArgs a: b:
After call to powerArgs a: b:
Goodbye!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
