C Here - Programming In C in Linux and Raspberry Pi by Andrew Johnson

C Here - Programming In C in Linux and Raspberry Pi by Andrew Johnson

Author:Andrew Johnson
Language: eng
Format: azw3, epub
Publisher: Andrew Johnson
Published: 2017-05-27T07:00:00+00:00


*/

void c_to_f (int degrees_c)

{

printf (“%d Degrees C = %d degrees F”,

degrees_c, ((degrees_c * 9) / 5) + 32);

}

int main ( )

{

c_to_f (20);

c_to_f (25);

}

Program Notes

We define a 'C' function of “type void” (see later).

We specify it will take single integer value as an argument or parameter.

We write the function so it just prints out the converted value.

We call the function twice from the main program, with slightly different values.

Returning a Value from a Function.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.