Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // define a new function named "addThree" which takes an int argument
- int addThree(int input)
- {
- // return the result of the expression "input+3"
- return input+3;
- }
- // define the standard entrypoint for a C program, "main()"
- int main()
- {
- // initialize variable n
- int n = 0;
- // call addThree the parameter literal integer "2"
- // store the returned value in n
- n = addThree(2);
- // add 5 to n and store the result in n
- n = n + 5;
- // exit program by returning from main
- // 0 is the standard "OK" program exit code
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement