Writing your own functions
Alright everyone check this out I'm a first year programming student and were in the chapter where we are required to write our own functions. Well the book we have is kind enough to give us functions with one variable
example.#include <stdio.h>
double tempvert(double);
int main()
{
int count;
double fahren;
for (count = 1; count <= 4; ++count)
{
printf("enter a temparature\n");
scanf("%lf", &fahren);
printf("the celsius equivilent is %6.2lf\n", tempvert(fahren) );
}
return 0;
}
double tempvert(double fahren)
{
return ( (5.0 / 9.0 * (fahren - 32) ));
}
but unfortunatley they neglect to give us any examples of writing your own function which would contain two variables. So basically I've been left out to dry by the book. I tried working it out logically and it just isn't making any sense does anyone out there have an example using two variable prewritten functions