CIS126: PROGRAMMING I
OnyourmarkUnit 3 Discussion
Modules in C are called functions. C programs are typically written by combining user-created functions as well as “pre-packaged” functions found in the C Standard Library. For instance, printf() is a function that is found in the C Standard Library and is accessed through the stdio.h header file.
In this Unit, we are going to focus on creating our own functions. Create your own function and upload it to the forum area for discussion. Make sure that you include the correct syntax (function prototype, function call, and function definition). You can create a function that can do any kind of task. For instance, the function may display a message to the screen or compute a value. Let’s look at an example:
#include <stdio.h>
void PrintMessage(void); //function prototype
int main (void)
{
PrintMessage(); //function call
return 0;
}
void PrintMessage(void) //function definition
{
printf(“Create your own function”):
}
This program will call the function PrintMessage in main() and display the text Create your own function to the output screen.
- 10 years ago
- 5
Purchase the answer to view it
- functions.docx
Purchase the answer to view it
Purchase the answer to view it
- basicprogram.zip
- HCS 433 Week 1 Perspective of Aging Paper
- GEN 480 Week 3 DQs
- GBM 489 Week 3 Assignment - Global Business Plan-Operations
- EXP 105 Week 4 - DQ 2
- BIO 101 Week 2 Family Tree Presentation
- Week 5 DQ
- Criminal Justice 3 Questions at least 75 words each
- PHL 251 Week 5 DQs
- MGT 300 Week 2 Individual Assignment Profile of a Small Business
- HRM 324 Week 2 Team Assignment Wage Management