We have to however declare function/s before use and this declaration must be similar to how we define functions.
Check this sample program:
#include
using namespace std;
float convert(float feet);
main()
{
float xfeet;
cout<<"input values for feet:";
cin>>xfeet;
cout<<"Equivalent in inches: "<
cin.get();
cin.ignore();
}
float convert(float feet)
{return feet*12.00;}
You can write this in C by replacing the input and output functions with scanf() and printf() and the predefined library of stdio.h.
No comments:
Post a Comment