my code stock.com

Snippet options

Download: Download snippet as arreglos-i.c.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int notas[5] = {10,5,4,1,0};



    //mostrar un arreglo - fea version

    /*

    printf("%d\n",notas[0]);
    printf("%d\n",notas[1]);
    printf("%d\n",notas[2]);
    printf("%d\n",notas[3]);
    printf("%d\n",notas[4]);

    */

    // mostrar un arreglo de la manera correcta

    /*
    int indice = 0;
    int limite = 5;
    for (indice = 0; indice < limite; indice++)
    {
        printf("numero almacenado en la pos %d : %d\n",indice+1,notas[indice]);//utilizo como posicion o indice una variable que ir cambiando para ir recorriendo
    }
    */

        int empleados[10];

    //cargar mala de empleado

    /*

    int indice = 0;
    printf("ingrese empleado #%d\n",indice+1);
    scanf("%d",&empleados[indice]);
    indice = indice + 1 ;

    printf("ingrese empleado #%d\n",indice+1);
    scanf("%d",&empleados[indice]);
    indice = indice + 1 ;

    */

    int indice = 0;
    int limite = 10;

    /*

    for (indice = 0; indice < limite; indice++)
    {
        printf("ingrese empleado #%d\n",indice+1);
        scanf("%d",&empleados[indice]);
        system("cls");
    }

    */

    for (indice = 0; indice < limite; indice++)
    {
        printf("numero almacenado en la pos %d : %d\n",indice+1,empleados[indice]);//utilizo como posicion o indice una variable que ir cambiando para ir recorriendo
    }

    return 0;
}

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.