You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Takes an item name, price, and quantity from the user and prints the total cost, formatted with a currency symbol and two decimal places.
What I learned
fgets keeps the trailing newline in the buffer, so it has to be stripped manually (item[strlen(item)-1] = '\0'), a gotcha that higher-level languages hide. I also practiced mixing string, float, and int input in one program and formatting output cleanly.