PARTICIPATION ACTIVITY A8.3.5: Function with pass by pointer Given the following
ID: 3595013 • Letter: P
Question
PARTICIPATION ACTIVITY A8.3.5: Function with pass by pointer Given the following ConvDigits0 function, void ConvDigits(int inNum, int* tensval, int* onesval) 1) What is the value of the variable numTens, after the following int numTens; function call? int numones ConvDigits (45, &numTens;, &numones;); Check Show answer 2) What is the value of the variable numOnes, after the following int numTens; function call? int numones ConvDigits (93, &numTens;, &numones;); Check Show answer 3) Provide the code needed to obtain a pointer to a variable named tensDigit Check Show answer 4) Write a function call using ConvDigits0 to store the tens place and ones place digits of the number 32 within the variables tensDigit and onesDigit. End with Check Show answer Feedback?Explanation / Answer
1) Ans : In ConvDigits function for numTens here doing division so the value of numTens - 4
2) Ans : In ConvDigits function for numTens here doing modulus so the value of numOnes - 3
3) Ans : As per my understand i have to replace tensVal with tensDigit. So Code will be like follows below.
void ConvDigits(int inNum,int* tensDigit,int* onesVal)
{
*onesVal=inNum%10; *tensDigit=inNum/10;
}
4) Ans : ConvDigits(32,&tensDigit,&onesDigit);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.