cannot compile the program

hello there..
i cannot compile the following program..please need your help

//This program will be used to find different functiond
#include<iostream>
#include<conio.h>
int f(int x,int y);//declare a function
int g(int a,int b);// a and be are formal parameters
int k(int e,int r);
int h(int i,int m);
int l(int o,int b);
int m(int f,int z,int j);
using namespace std;
int main()
{//start main
int x=7,y=2;
cout<<"f(x,y)="<<f(x,y)<<endl;
cout<<"g(x,y)="<<g(x,y)<<endl;
cout<<"k(x,y)="<<k(x,y)<<endl;
cout<<"h(x,y)="<<h(x,y)<<endl;
cout<<"l(x,y)="<<l(x,y)<<endl;
cout<<"m(x,y)="<<m(x,y)<<endl;
cout<<"(Press any key to continue)";
while(!kbhit());
}//End main

int f(int x,int y)
{
return x+y;
}//end of f
int g(int w,int s)
{
int z;
z=w-s;

return z;
}//end of g
int k(int e,int r)
{
int j;
j=e*r;
return j;
}//end of k
int h(int i,int m)
{
int u;
u=i/m;
return u;
}//end h
int l(int o,int b)
{
int v;
v=o%b;
return v;
}//end v
int m(int f, int z,int j)
{
int c;
c=f*z+j;
return c;
}//end m


it says too many arguments with int
i'll appreciate any help from you:)
You declared a function with three parameters:

 
int m(int f,int z,int j);

However, when you called that function you only passed two parameters:

 
cout<<"m(x,y)="<<m(x,y)<<endl;

hi,

The only error that i found was that you dont have enough parameters in the call to m(f,z,j)

I changed this line

 
    cout<<"m(x,y)="<<m(x,y)<<endl;


to

 
    cout<<"m(x,y)="<<m(x,y,1)<<endl;


and it compiled and ran
note you might want to change the '1' to a variable

hope this helped
Shredded

EDIT: came up with the same thing at the same time sorry about that.
Last edited on
thank you Tabian and shredded for your help
i'm going to try it again
i'm just wondering how can i post my program in the proper way like you do..
i just copy it and paste it ..i dont know how i can write it like you do .. i mean line numbers with font colours
it's ok shredded and thank you for helping me again :).
To the right of the text box, you'll see icons under "Format." Click the button that looks like "<>" that represents source code.
Thank you tmoney ..going to try it next time:)
Topic archived. No new replies allowed.