Use of diferent Functions

Here is a code showing diferent functions #include <iostream> using namespace std; int num1, num2, res, dif, mul; float div; int resta(int a, int b) { dif = a – b; return (dif); } int mult(int a, int b) { mul = a * b; return (mul); } int residuo(int a, int b) { res […]

Read more "Use of diferent Functions"

Guess the code

Here is an other guess the code, guess what the code do in the comments #include <iostream> #include <string> using std::string; using std::cout; using std::cin; using std::endl; int main(){ string palabra, alreves, respuesta; cout << “Dame la palabra ” << endl; cin >> palabra; // cout << palabra; int tamano = palabra.length(); for(int i = […]

Read more "Guess the code"

Guess the code

Here is a new code, guess what it does #include <iostream> using namespace std; int a , b, c, d; int main() { cout << “escribe un numero” << endl; cin >> a; cout << “escribe otro numero” << endl; cin >> b; cout << “escribe otro numero” << endl; cin >> c; cout << […]

Read more "Guess the code"

Use of comments

Here is a code of how to use comments #include <iostream> using namespace std; // Add a Double “//” then just type. The program will ignore the text after the “//” int main() { cout << “Hello world!” << endl; // No matter where in the code it is /* you can also use “/*” […]

Read more "Use of comments"

Final project

Here is the final result of our final project. its about a code that gets the coordenates for a solid for you to graph it. I worked with Josue reyes and Rodrigo Zermeño #include <iostream> #include <fstream> #include <cmath> #define pi 3.14159 using namespace std; char figura; int HP, LP1, LP2, HC, RC; float x, […]

Read more "Final project"

for and nested for

Here is a code showing how to do a nested for #include <iostream> using namespace std; int a; int main() { cout << “For example ” << endl; for (int x= 0 ; x <= 10;x++ ) { cout << “Este es el ciclo numero ” << x << endl; } cout << “——————————————————————————–” << […]

Read more "for and nested for"

Factoriales

Here is a little fuction that helps get factorials   #include <iostream> using namespace std; int main(){ int n, contador; string respuesta; cout << “Número Factorial ” << endl; do { cout << “Dame un número positivo ” << endl; cin >> n; contador = n; do { contador = contador – 1; n = […]

Read more "Factoriales"