Create a source code that will prompt for recive and total a collection of payroll amounts entered at the terminal untill a sentinel amount of 999 is entered. Here is what i have so far i know not much but am not that great at this class.

#include <stdio.h>
#include <stdlib.h>

main()

{

int total payroll amounts;
float 0;

printf("Enter a number(999 to stop)");
scanf("%d" , &num);

//*putting the first number the user entered

while(num=999)
{

To create a source code that prompts for and totals a collection of payroll amounts entered at the terminal until a sentinel amount of 999 is entered, you can make the following modifications to your existing code:

```c
#include <stdio.h>

int main() {

int num; // variable to store the payroll amount
int total = 0; // variable to store the total amount

printf("Enter a number (999 to stop): ");

while (scanf("%d", &num) == 1 && num != 999) {
total += num; // add the entered amount to the total
printf("Enter another number (999 to stop): ");
}

printf("The total payroll amount is: %d\n", total);

return 0;
}
```

Explanation:

1. The `total` variable is initialized with zero to hold the total sum of payroll amounts.
2. The while loop continues until the `num` variable becomes 999. If the user enters 999, the loop will exit.
3. Inside the loop, the user is prompted to enter a payroll amount. The scanf function is used to read the entered value and store it in the `num` variable.
4. The entered amount is added to the `total` variable using the `+=` operator. This is a shorthand way to say `total = total + num`.
5. After each input, the user is asked to enter another number until they enter 999 to stop the loop.
6. Once the loop exits, the final total payroll amount is displayed using printf.

Make sure to include the necessary libraries and define the appropriate data types for your program to compile successfully.