#include
using namespace std;
int mult ( int x, int y );
int main()
{
int x;
int y;
cout<<"Please input two numbers to be multiplied: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x , y ) <<".\n";
cin.get();
}
int mult (int x, int y )
{
return ( x * y );
}
This program, which is an example from the tutorial, asks you for two numbers and multiplies them. A very basic example of functions.I still have more to work on with the functions. The more advanced functions will be tougher and, judging by what's ahead of me in the tutorials, I might want to spend more time with the simpler things and make sure I have them down.
1 comment:
Any comments on Zhanar's presentation? Feel free to post them on her Blog.
http://zorbax.blogspot.com
~Richard.
Post a Comment