PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
C Intro
Functions
Function with Parameters and Return Value.c
1
/*
2
Function with Parameters and Return Value.c
3
4
Pass parameters to a function, let it do its job, and display the result
5
it returns.
6
7
http://learn.parallax.com/propeller-c-functions/function-parameters-and-return
8
*/
9
10
#include "simpletools.h"
// Include simpletools
11
12
int
adder(
int
a,
int
b);
// Function prototype
13
14
int
main
()
// main function
15
{
16
int
n = adder(25, 17);
// Call adder function
17
print(
"adder's result is = %d"
, n);
// Display adder function result
18
}
19
20
int
adder(
int
a,
int
b)
// adder function
21
{
22
int
c = a + b;
// Add two values
23
return
c;
// Return the result
24
}
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12