Can you please solve question 3, the plusminus one using C language only. Assign
ID: 3750859 • Letter: C
Question
Can you please solve question 3, the plusminus one using C language only. Assignment - In progress Complete the form, then choose the appropriate button at the bottom Title Due Number of resubmissions allowed Accept Resubmission Until Status Homework #04 Sep 20, 2018 5:00 pm Sep 20, 2018 5:00 pm Not Started Instructions Homework: write a C funcion int odd ( int x) that returns 1 if x is odd and returns 0 if x is even. Can you Homework: Write rotate 3 ( A, B, ) that sets A to the old value of B, sets B to old C, and C to old A. Homework: Write plusminus (x,y) that sets x to old x+ old y and sets y to old x -old y. Submission Assignment Text This assignment allows submissions using both the text box below and attached documents. Type your submis "select files" button to include other documents. Save frequently while working.Explanation / Answer
1- Without using any temporary variable
void plusminus(int *x,int *y) {
*y=*x-*y;
*x=*x-*y+*x;
}
2- Using Third Variable z
void plusminus(int *x,int *y) {
int z=0;
z=*x+*y;
*y=*x-*y;
*x=z;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.