Can't figure out why my C program isn't working. Need to write a program that calculates weekly salary of each salesperson until -1 is entered. Here's my code: #include int main(void) { float...


Can't figure out why my C program isn't working.


Need to write a program that calculates weekly salary of each salesperson until -1 is entered.


Here's my code:


#include


int main(void)
{


float sales=0;
while (sales != -1)
{printf("Enter sales in dollars (-1 to end): "); // prompt user for input
scanf("%f\n", &sales); // obtain value


float salary;
salary = (sales * .09) + 200; // calculates salary
printf("Salary is: $ %.2f\n", salary); // give salary amount to user
}
return 0; //end program
}



tinclude <stdio.h><br>int main(void)<br>{<br>float sales=0;<br>while (sales != -1)<br>{printf(

Extracted text: tinclude int main(void) { float sales=0; while (sales != -1) {printf("Enter sales in dollars (-1 to end): "); // prompt user for input scanf("%f\n", &sales); // obtain value float salary; salary = (sales * .09) + 200; // calculates salary printf("Salary is: $ %.2f\n", salary); // give salary amount to user } return 0; //end program

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here