attached is the code that i have written. i need help printing the arrays using pointers
2. Write a C program, named last10.c, whose input is an unknown number of integers. The program stops reading when it encounters a zero. The program then prints the last ten numbers it read (not including the zero), in the order they were given. If less than 10 numbers were input, the program should print them all. For example: adminuseradminuser-VirtualBox -/Desktop/SP2020-HWS/HW2 5 last10 1 2 4 55 7 9 23 0 1 2 4 55 7 9 23 adminuser@adminuser-VirtualBox -/Desktop/SP2020. HUSA 1 2 3 4 5 6 7 8 9 10 11 12 0 astio 3 4 5 6 7 8 9 10 11 12 adminuser@adminuser-VirtualBox -/Desktop/SP2020-HWS/HW2 S Your program must not assume anything about the number of input values, which means that you can't declare an array to hold all of them. Instead, you should declare an array of 10 integers, and use it like a circular queue. (You do remember data structures, right?) In particular, keep a pointer to the next open slot of the array. Use scanf to read an integer. If it is not zero, write it to that slot and increment the pointer. If incrementing the pointer puts it! beyond the end of the array, set it back to the first slot. when you read a zero. print the contents of the array. Note that you need to begin with the number that was entered least recently, which is not necessarily the number at the beginning of the array. See the second example in the above screenshot. Some people will want to implement the queue like this: Once the array is full, you shift the values in the array one position to the left in order to make room the next input value, which you insert at the far right of the array. This is awkward and inefficient, and a bad idea. Please DON'T do it this way. 1 #include
3.//Main Function 4 int main() 5 { int number; int a[10]; int *ptr = a; int count = 0; scanf("%d", &number); //Initializing number //Initializing an array called a //Initializing a pointer //Initializing a count 12 //Determining the count of numbers while (number != 0) *ptr = number; if (count 0) me int *temp; if (count > 10 || count != 10) *temp = | else ptr++; printf("%d", *ptr); 47 49]