Thread: small problem
View Single Post
Old May 21st, 2005, 7:41 PM   #3
nez
Programmer
 
nez's Avatar
 
Join Date: May 2005
Location: Plymouth UK
Posts: 34
Rep Power: 0 nez is on a distinguished road
Send a message via MSN to nez
#include <stdio.h>

flaot tax;
int price; 
float total;

int main()
{
tax=0.15;
printf("What is the Cost?");
scanf("%d", &price);

total=(price*tax)+price;

printf("\nTotal cost = %2.2lf\n",total);

return 0;
}

I think that does the same thing as what u were trying to do but without the define bit, calling total a flaot instead

is this any help?
(i found it useful for me even if it didnt help you)

nez
__________________
atariboy.wordpress.com
nez is offline   Reply With Quote