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

ok so im working on a lab for school and I am confused by what they are asking f

ID: 3555105 • Letter: O

Question

ok so im working on a lab for school and I am confused by what they are asking from me:

, and put the coding to find the number of 10's in a number into a user defined (helper) function named f1. Set the initial number in a variable named x in the main function and print it out to check that it was set correctly). Your code will then pass x to a variable named y in f1- the syntax for the call is of course f1( x ); . (That is, you arecopying the value in the argument variable x into the parameter variable y.) f1 should return the number of 10's in y. After f1 returns, the main function should print the returned value. You should see the original number printed from the main function and the returned number of 10's in that original number, also printed from the main function.

the bolded area is where i am confused are they asking me to create a pointer from x in the main function to the function i created with the variable y and if so how would I do that. I feel like this is so simple but the wording is messing me up. could someone write this particular part of the code.

Explanation / Answer

#include<stdio.h>

int f1(int *y)
{
return (*y)/10;
}

int main()
{
int x = 240;
int* y = &x; // create a pointer from x in the main function to the function i created with the variable y
f1(y);

return 0;
}