I amm getting 3 errors for , please help..
error C2660: 'calculate_disc ount' : function does not take 1 arguments
the code is
error C2660: 'calculate_disc ount' : function does not take 1 arguments
the code is
Code:
#include <stdio.h> #include <conio.h> int calculate_discount(int,int,int); int main() { int item1,item2,item3; int price1,price2,price3; /* For reference Item Discount Item 1 20% Item 2 30% Item 3 40% */ printf("Enter Price for Item 1: \n"); scanf("%d",&item1); printf("Enter Price for Item 2: \n"); scanf("%d",&item2); printf("Enter Price for Item 3: \n"); scanf("%d",&item3); printf("Net price of Item 1: %d \n",calculate_discount(item1)); /*ERROR IS HERE*/ printf("Net Price of Item 2: %d \n",calculate_discount(item2)); /*ERROR IS HERE*/ printf("Net Price of Item 3: %d \n",calculate_discount(item3)); /*ERROR IS HERE*/ getch(); } int calculate_discount(int item1,int item2, int item3) { int price1,price2,price3; if(item1) price1=item1-((item1*20)/100); else if(item2) price2=item2-((item2*20)/100); else if (item3) price3=item3-((item2*20)/100); return item1,item2,item3; }
Comment