Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. a.Write a single assignment statement that assigns to k the 1\'s digit of the

ID: 3629351 • Letter: 1

Question

1. a.Write a single assignment statement that assigns to k the 1's digit of the value of j. For example, if j has a value of 235, your assignment statement should end up assigning a value of 5 to k. (Hint: the right-hand side of the assignment statement should be an expression that uses the modulus operator (%)). Make sure that your statement works for an arbitrary value of j.
b. Write a single assignment statement that assigns to k the 10s digit of the value of j. For example, if j has a value of 235, your assignment statement should end up assigning a value of 3 to k; if j has a value of 8, your statement should end up assigning a value of 0. (Hint: the right-hand side of the assignment statement should be an expression that uses two mathematical operators.) Make sure that your statement works for an arbitrary value of j.

Explanation / Answer

please rate - thanks

a)       k=j%10;

b)      k=j/10%10;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote