Ejercicios de examan Con Arreglos

download Ejercicios de examan Con Arreglos

of 1

Transcript of Ejercicios de examan Con Arreglos

  • 7/26/2019 Ejercicios de examan Con Arreglos

    1/1

    1.

    LLENAR LOS 20 ELEMENTOS DE UN ARREGLO CON PUROS NUMEROS PARES, EMPEZANDO

    CON EL 2

    2.

    LLENAR UN ARREGLO DE 20 ELEMENTOS CON LOS VALORES DE LA TABLA DE MULTIPLICAR

    DE CUALQUIER NUMERO LEIDO DESDE EL TECLADO. Piden un numero y lo multiplican por

    1, despus por 2, despus el 3 y as hasta el 20, y el resultado lo guardan en un arreglo

    3.

    LLENAR UN ARREGLO DE 50 ELEMENTOS CON 0 LAS POSICIONES PARES Y CON 1 LAS

    POSICIONES NONES (supn que la posicin 0 es par), el arreglo quedara as a[0] = 0,

    a[1]=1, a[2]=0, a[3]=1, a[4]=0,a[5]=1 a[49]=0

    4.

    LLENAR UN ARREGLO DE 100 ELEMENTOS CON NUMEROS AL AZAR DEL 350 AL 550;

    5.

    LLENAR UN ARREGLO DE 20 ELEMENTOS E IMPRIMIRLO AL REVES

    6.

    LLENAR UN ARREGLO DE 10 ELEMENTOS E INVERTIR SUS VALORES, por ejemplo a[0]

    tendr el valor de a[9] y a[9] tendr el valor de a[0], a[1]tendr el valor de a[8] y a[8]

    tendr el valor de a[1], lo mismo para las dems posiciones

    7.

    LLENAR UN ARREGLO DE 100 ELEMENTOS CON NUMEROS AL AZAR DEL -50 AL 50 Y PONER

    EN OTRO ARREGLO LOS NUMEROS POSITIVOS Y EN EL ULTIMO ARREGLO LOS NEGATIVOS

    8.

    LLENAR UN ARREGLO DE 10 ELEMENTOS CON NUMEROS AL AZAR DEL 1 AL 20 Y MOSTRAR

    EN PANTALLA TANTOS ASTERISCOS, COMO EL VALOR DEL ELEMENTO DEL ARREGLO.

    Ejemplo: si a[0]=8, a[1]=5,a[2]=7, a[3]=1 entonces imprime

    ********

    *****

    *******

    *

    9.

    LLENA UN ARREGLO DE 20 ELEMENTOS E IDENTIFICA CUANTES VECES SE REPIENTEN LOS

    VALORES, ejemplo: si a[0]=1, a[1]=4, a[2]=4, a[3] =3, a[4]=3 entonces se repiten 4

    nmeros10.

    DECLARAR UN ARREGLO DE 20 ELEMENTOS, DONDE LAS PRIMERAS 5 POSICIONES

    TENDRAN UN VALOR DE -1, LAS SIGUIENTE 5 POSICIONES TENDRAN UN VALOR DE 0, LAS

    OTRAS 5 POSICIONES VALOR = 1 Y LAS ULTIMAS 5 POSOCIONES TENDRA UN VALOR DE 2