i got error

For every selling price, it is the sum of the cost price and the amount of profit. Write a program with a VOID function to input the rate of profit, cost price and calculate the selling price. Display the selling price.






#include<Miostream.h>
#include<conio.h>

float sellingprice(float,float)
int main()
{
float price,profit,sellingprice;

cout<<"enter the profit"<<endl;
cin>>profit;
cout<<"enter the cost price"<<endl;
cin>>price;

sellingprice = profit(priice,sellingprice)

cout<<"selling price is:"<<sellingprice<<endl;
getch();
return 0;
}

float sellingprice;

selingprice = profit + rpice;
return sellingprice;
}
Use [code] tags and tell us what the error was.
You are missing a semicolon when you declare the prototype for sellingprice, and you are also shadowing sellingprice by making a variable with the same name in the main function.
also instead of declaring the selling price function you are declaring a global variable then have random stuff after it and anyways you don't even have an opening brace...

functions are declared like
1
2
3
4
<type> <name>( <parameters> )
{ //opening brace
    ... //stuff
} //closing brace 
Topic archived. No new replies allowed.