Question Locked

Simple C Program

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Modify the C program so that the user inputs the purchase amount. Calculate and display the tax amount for the stores selected and the total sale amount for that store.

/*Rochelle Cook

#include

main()
{
float delmar;
float encinitas;
float lajolla;

float resultdelmar;
float resultencinitas;
float resultlajolla;

delmar=7.25;
encinitas=7.5;
lajolla=7.75;

resultdelmar=125*delmar;
resultencinitas=125*encinitas;
resultlajolla=125*lajolla;

printf("delmar sales tax cost is $%.2f\n",resultdelmar);
printf("encinitas cost is $%.2f\n",resultencinitas);
printf("lajolla cost is $%.2f\n",resultlajolla);
getch();

2 replies

by scott_heath

I know I should learn more C, but VB is just soooooo easy!

Use fgets. I'll let you Google to find the syntax, but that should get you started. Looks like you in school, so we wouldn't want to do your homework for you!

This discussion is closed to new replies.