Programacion basica c
Program flow sentences (change the order of the program, can jump to the end, etc)
Conditionals
* If , Else (singles and nested)
* If (logic sentence) { completedwhen the logic sentence is true)
* ….
* }
* Else { completed when the logic sentence is false, it is optional
* …
* }
* Switch
* Case
Cycles, loops
*For
* While
* Do while
The float is used to represent real numbers, (decimals, and integers)
Logic sentence (true or false) -> boolean sentence (logic and relational)
Estructura Basica(Dev Cpp)
#include
#include
int main()
{
system("PAUSE");
return 0;
}
“ ” Comillas se utilizan para una palabra
‘ ’ Comillas sencillas para letras
Al crear un nuevo documento, darleGuardar Como antes de hacer algun cambio.
a--, a=a-1
a++, a=a+1 is similar to a++
== is used when we are
Arrays
Arrays start with 0 and end with n-1. Si mencionas un element de la lista que noexiste, creara un error pero no aparecera al momento de compilar.
Para definir el numero de elementos en el array tenemos que ponerlo como N sin contar el 0.
Una matriz de 2x3 se acomoda demanera linear para el pogramador
0,0 | 1,0 |
0,1 | 1,1 |
0,2 | 1,2 |
1,2 | 5 |
1,1 | 4 |
1,0 | 3 |
0,2 | 2 |
0,1 | 1 |
0,0 | 0 |
Para obtener el valor abosluto de la columnautilizamos la formula
c*r + row.
1*3 + 2 = 5 5
Matrices que cambien culumans y filas
Restringir las opciones
Parking lot program
Structure
Euclides algorithm and the MCD (maximum common divisor)Sometimes is really difficult to calculate a number with a complex function in real time, so we create a table with each value so if a value is entered, the result is given in real time.
Pointers& -> Addres of the operator (the location of the variable
While
While is used as a loop/iteration statement.
The syntax is:
while (expr)
statement
The expression is evaluated and the...
Regístrate para leer el documento completo.