Saltar al contenido principal
LibreTexts Español

7.5: Ejercicios

  • Page ID
    82025
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Ejercicio\(\PageIndex{1}\)

    Escribe el código para examinar el valor de la variable X. Si es menor que cero, se debe imprimir el valor negativo del mensaje.

    Ejercicio\(\PageIndex{2}\)

    Escribe el código para examinar el valor de la variable X. Si es igual a cero, se debe imprimir el valor cero del mensaje.

    Ejercicio\(\PageIndex{3}\)

    Escribe el código para comparar los valores de las variables X e Y. Se debe imprimir el mayor valor.

    Ejercicio\(\PageIndex{4}\)

    Escribe el código para examinar los valores de las variables X e Y. Si tanto X como Y son mayores que cero, increme X en uno.

    Ejercicio\(\PageIndex{5}\)

    Escribe el código necesario para imprimir el mensaje ¡Error! seis veces pero sin usar seis llamadas secuenciales printf ().

    Ejercicio\(\PageIndex{6}\)

    Escribe el código requerido para controlar un bucle para que continúe siempre y cuando la variable K sea menor a 50.

    Ejercicio\(\PageIndex{7}\)

    Escribe el código necesario para ciclar la variable R de 100 a 200 en pasos de 5 (es decir, 100, 105, 110, etc.).

    Ejercicio\(\PageIndex{8}\)

    Explicar la diferencia práctica entre un bucle while y un bucle do-while.


    This page titled 7.5: Ejercicios is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by James M. Fiore via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.