WSQ08 – On To Functions

Hey class, here is a new post, it is about functions.

A function is a set of instructions with an specific goal. you specify some parameters so you can return some value.

More information

The program is almost the same as Fun with numbers, but, with functions. Here is my program.

FUNCTIONS

But basically you create a fucntion like this:

int suma ( int a, int b)
{
int s;
s=a+b;
return s;}

You declare the type of function you want in this case an int, then you name the function and include the values, after that you code everything you want the function to do and thats all. In the program you just code this

s= suma(a, b);

And you print it. C:

CC BY-SA 4.0 WSQ08 – On To Functions by alibarramg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.