-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: #mastery12
#Mastery11 and #Mastery12 #TC1017
Comments Off on #Mastery11 and #Mastery12 #TC1017
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #mastery11, #mastery12, #TC1017
Mastery11 and 12
Comments Off on Mastery11 and 12
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #333333, #mastery11, #mastery12, #TC, #TC1014, Mastery
#TC1014 #Mastery11 #Mastery12
Comments Off on #TC1014 #Mastery11 #Mastery12
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #222222, #8cbf99, #mastery11, #mastery12, #TC, Mastery
Funciones en C++
Aqui esta un nuevo tutorial para como poder crear una funcion que hago o desarrollo un codigo especifico del programa y despues como poderla llamar y usarla en el codigo principal.
Aqui esta el link:https:/
#TC1017
#Mastery11
#Mastery12
Comments Off on Funciones en C++
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #mastery11, #mastery12, #TC, #TC1017, Mastery
#Mastery12 Courses with Ken
Comments Off on #Mastery12 Courses with Ken
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #mastery12, #TC1014, Sin categoría
#Mastery12 Courses with Ken
Comments Off on #Mastery12 Courses with Ken
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #mastery12, #TC1014, Sin categoría
#mastery12
I´m goint to teach how to create a function in c++
First of all you have to choose which type of function you want.
Void = to return nothing.
Int = to return a integer number.
double = to return a decimal number.
bool = to return true or false
string = to return letters.
etc etc.
Well now that you know the types of functions you will have to select the type you want for your variables which are pretty much the same.
Now, the syntax to do a function is:
type nameoffunction(variables, parameters)
{
}
——————————————–
Let´s say, we want to create a function which make the sum of two integer numbers
int sumnum(int x, int y)
{
int c;
c = x + y;
return c;
}
Hope you understand how to create a function, it is really easy and don´t be afraid to create them because it will save a lot of coding and your int main() will be a lot shorter.
Hope you understand so i can get my two points!
Comments Off on #mastery12
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #mastery12, #TC, #TC1017, Mastery
Creating C++ functions – Mastery12
*Crear una funcion es facil. El proceso para crear una es el siguiente:
1- Se programa la unción
2- Se define la función
3- Se utiliza la función en el programa principal.
*Su estructura es la siguiente:
Por ejemplo:
using namespace std;
int factorial(int a){
int cont, act = 1;
for (cont =1; cont
{
fact = fact*cont;
}
return fact;
}
int main(){
int num1;
int resultado = factorial (num1);
cout
cin num1;
cout
return 0;
}
Si tienen dudas pueden consultar el siguiente enlace: http:/
Comments Off on Creating C++ functions – Mastery12
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #include, #mastery12, #TC, #TC1017, Mastery
Mastery 12
Una función es un conjunto de líneas de código que realizan una tarea específica y puede retornar un valor. Las funciones pueden tomar parámetros que modifiquen su funcionamiento. Las funciones son utilizadas para descomponer grandes problemas en tareas simples y para implementar operaciones que son comúnmente utilizadas durante un programa y de esta manera reducir la cantidad de código.
habiendo dicho lo anterior podemos decir que, cuando seamos unos programadores avanzados, usaremos las funciones para acortar nuestras lineas de codigo o, lo que es lo mismo, facilitar nuestro trabajo, ya que, podremos hacer que las lineas de codigo que usaremos más se puedan escribir solo una vez y que, para volverlas utilizar solo debamos de escribir una linea de codigo en lugar de las tantas que usariamos si no tuvieramos las funciones.
¿como usar una función?
el primer paso es determminar que tipo de funcion va a ser, que nos va arrojar, podemos usar int, float, bool, o cualquiera que nosotros queramos usar
el segundo paso, es ponerle nombre a la función, este nombre puede ser en realidad el que nosotros queramos, puede ser desde “cuadratica” hasta “perrito” solo que es recomendable darle nombres relacionados con lo que ahce esa función, ya que si le ponemos “perrito” y trata sobre una función, esta puede llegarnos a confundir y cometer errores.
el tercer paso para realizar la funcion es poner entre parentesis, que y cuantas variables van a ser usadas en nuestra funcion, por ejemplo si queremos que sean tres variables enteras (a,b y c) las cuales vamos a necesitar en la realización de nuestra funcion llamada “ejemplo” y arrojara un numero entero, entonces quedaria asi: int ejemplo (int a, int b, int c)
despues de determinar que arrojara, el nombre y las variables de la funcion procederemos a habrir corchetes “{“, escribir lo que queremos que haga esa función y por ultimo, antes de cerrar nuestra funcion tenermos que poner “return” y la variable que queremos que regrese y por ultimo debemos de cerrar corchetes “}”.
Comments Off on Mastery 12
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #mastery12, #TC, #TC1017, Mastery
Creating and calling functions in C++
In order to creat a function we need to give it a name first and we need to do that before main, like this:
You need to be clear about whay type of function you are creating, in this case is a boolean, and then followed by the instructions that the function will perform in case you call it.
Now, to call a function you need to type in the name of it, followed by the data that the function will use to work, in this case is “input”, but it can be any data you want, as long as it’s the correct type of data that the function is ready to process.
As you can see here I typed in bool and the name of the function is palindrome, that’s how you call it, I hope this comes useful.
Comments Off on Creating and calling functions in C++
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #mastery11, #mastery12, #TC1017