41
Other Stuff / Error exporting in Power_C
« on: September 03, 2007, 07:02:32 AM »
Hey guys recently I've been tinkering with Power_C I was making a tax calculator and I get this error
taxcalc.c(11):scanf ("%d" &Price);
********** ^131
131: | and & do not apply to floats or doubles or pointers.
---------------------------------------------------------------------------
taxcalc.c(13)scanf("%d" &Taxrate);
********** ^131
131: | and & do not apply to floats or doubles or pointers.
---------------------------------------------------------------------------
21 lines compiled
2 Compile errors.
Here is what I put in taxcalc.c do you see anything wrong?
taxcalc.c(11):scanf ("%d" &Price);
********** ^131
131: | and & do not apply to floats or doubles or pointers.
---------------------------------------------------------------------------
taxcalc.c(13)scanf("%d" &Taxrate);
********** ^131
131: | and & do not apply to floats or doubles or pointers.
---------------------------------------------------------------------------
21 lines compiled
2 Compile errors.
Here is what I put in taxcalc.c do you see anything wrong?
Code: [Select]
main()
{
/* objects */
int Price;
int Taxrate;
int Tax;
/*asking for and receiving amounts*/
printf ("Please enter the first price (no more then 10000 please) to receive the amount/n");
printf ("of tax and the total cost:/n");
scanf ("%d" &Price);
printf ("Now please enter the tax rate:");
scanf ("%d" &Taxrate);
/*calcuating tax*/
Tax = Taxrate * Price;
/*displaying results*/
printf ("The tax for this item is:");
printf ("%5.10d");
}