#include <iostream>
#include <conio>
int subtraction (int,int);
int main ()
{
int x=5,y=3,z;
z=subtraction (7,2);
cout<<"The first result is "<<z<<'\n';
cout<<"The second result is "<<subtraction(7,2)<<endl;
cout<<"The third result is "<<subtraction(x,y)<<endl;
z=4+subtraction(x,y);
cout<<"The fourth result is "<<z<<'\n';
getch();
return 0;
}
int subtraction(int a, int b)
{
int r;
r=a-b;
return (r);
}
Hi, may I know why the above program no need declare variable for a and b inside line 4, but for the program below, if I don't declare the variable in line 4(which is same as the above example), the program cannot run?
Thanks...