1 / 8

Programación

Programación. Clase 1. Gabriela Araya Baez. Variables. Char: Variable que almacena caracteres. Int: Variable que almacena enteros. Float: Variable que almacena decimales.

ulema
Download Presentation

Programación

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programación Clase 1 Gabriela Araya Baez.

  2. Variables Char: Variable que almacena caracteres. Int: Variable que almacena enteros. Float: Variable que almacena decimales. Doble: Variable que se ocupa cuando necesitamos realizar cálculos muy exactos. Bool: Sirve para evaluar expresiones lógicas.

  3. Operadores matemáticos + suma - resta * multiplicación / división % modulo ++ incremento (suma 1) -- decremento (resta 1)

  4. Operadores relacionales >= mayor igual <= menor igual = igual != distinto de Operadores lógicos And && Or ||

  5. Estructura del programa Librerías Declaraciones globales Int main(int argc, char *argv[]) { variables; funciones; system(“pause”); return 0; }

  6. Función printf Esta función sirve para escribir datos en la consola o pantalla de salida. Si se quiere poner un texto en la pantalla tiene esta estructura: printf(“ texto ”); Si se desea imprimir un valor se ocupa de esta manera: printf(“ texto %d” ,variable_entera);

  7. Función scanf Esta función sirve para leer datos, que son ingresados por consola, y su estructura dependerá del tipo de variable ingresada. Si se lee un Char scanf(“%c” , &variable); Si se lee un Int scanf(“%d” , &variable); scanf(“%i” , &variable); Si se lee un Float scanf(“%f” , &variable);

  8. Función getch Esta función también es conocida como getche(), y se utiliza para capturar un carácter y no todo un string. Esta variable no muestra en el canal de salida el carácter capturado. Se escriben: getche() y getch()

More Related