when i run it is giving me an error saying illegal use of floating point and cannot covert 'float(*)(float) 'to 'float'
this is the source code
Code:#include <stdio.h> #include <conio.h> int discount (int x); float tax (float y); main () { int code[10]; int i,after_discount; float after_tax,total; int cost=500; for (i=1;i<10;i++){ printf ("Enter the book code"); scanf ("%d", &code[i]); } total = 500.00 * 10; after_discount = total - discount (cost); after_tax = after_discount + tax (total); printf ("Discount is: %d\n", discount(cost)); printf ("After discount: %d\n", after_discount); printf ("Tax is : %.2f\n", tax (total)); printf ("Amount to be paid: %.2f", after_tax); printf ("Book Codes\n"); for (i=1;i<10;i++){ printf ("\t%d", code[i]); } getch (); return 0; } int discount ( int x) { int four_books,discount; four_books = x * 4; discount = 0.10*four_books; return discount; } float tax (float y) { tax = 0.10 *y; return tax; }



LinkBack URL
About LinkBacks


