10
UNIVERSIDAD POLITÉCNICA AMAZÓNICA INTEGRANTES: ARRAY BIDIMENCION AL o ALTAMIRANO CORDOVA, Sheylly Nathaly. o CHAVEZ CHAPA, Sady Yubitza. CURSO: o MICROPROCESADORES DOCENTE: o MARCO PORRO

Array bidimensional

Embed Size (px)

Citation preview

Page 1: Array bidimensional

UNIVERSIDAD POLITÉCNICAAMAZÓNICA

INTEGRANTES:

ARRAY BIDIMENCION ALo ALTAMIRANO CORDOVA, Sheylly

Nathaly.o CHAVEZ CHAPA, Sady Yubitza.CURSO:o MICROPROCESADO

RESDOCENTE:o MARCO PORRO

Page 2: Array bidimensional

DEFINICIÓN:Los arreglos bidimensionales son tablas de valores. Cada elemento de un arreglo bidimensional está simultáneamente en una fila y en una columna.En matemáticas, a los arreglos bidimensionales se les llama matrices, y son muy utilizados en problemas de Ingeniería.En un arreglo bidimensional, cada elemento tiene una posición que se identifica mediante dos índices: el de su fila y el de su columna. Los arreglos son objetos implícitos que siempre conocen sus propias longitudes (values.length) (diferencia con C++ donde un arreglo no es nada más que un puntero) y que se comportan como clases finales.

Page 3: Array bidimensional

DECLARACIÓN:Un array bidimensional se Declara de la siguiente manera:

[Dimensión_fila] [Dimensión_columna] Por ejemplo: Datos [3] [5] de tipo entero

Id_arreglo = ARREGLO [limInfR..limSupR,limInfC..limSupC] DE tipo

Por ejemplo: matriz = ARREGLO [1..15, 1..5] DE reales

Page 4: Array bidimensional

OPERACIONES:Suma de Matrices Consiste en sumar A+B, es decir aij +bij resultando una nueva matriz C, donde cada posición cij aij +bijEjemplo:

Page 5: Array bidimensional

Multiplicación por un escalarConsiste en multiplicar cada aij por una constante kEjemplo:

Page 6: Array bidimensional

Multiplicación de matricesPrimero debe verificarse el número de filas y columnas de las dos matrices A y B, el resultado se almacena en la matriz C, de la siguiente forma: cij aik +bkjEjemplo:

Page 7: Array bidimensional

EJEMPLOS:

 #include <stdio.h>#include <stdlib.h> int main(void){            int x,tabla[100];                       for (x=1;x<=100;x++)            {        tabla[x]=x;    }                       for (x=1;x<=100;x++)            {        printf("%d\n",tabla[x]);    }               system("PAUSE");         return 0;}

1. Que  rellene un array  con  los  100 primeros números  enteros  y  los muestre en pantalla en orden ascendente.

Page 8: Array bidimensional

EJEMPLOS:2. Que rellene un array con los 100 primeros números enteros y los muestre en pantalla en orden descendente.

#include <stdio.h>#include <stdlib.h> int main(void){            int x,tabla[100];                       for (x=1;x<=100;x++)            {        tabla[x]=x;    }                       for (x=100;x>=1;x--)            {        printf("%d\n",tabla[x]);    }

    system("PAUSE");         return 0;}

Page 9: Array bidimensional

EJEMPLOS:3. Que rellene un array con los números impares comprendidos entre 1 y 100 y los muestre en pantalla en orden ascendente.

#include <stdio.h>#include <stdlib.h> int main(void){            int x,cont,z,i,tabla[100];                       i=0;            for (x=1;x<=100;x++)            {        cont=0;        if (x%2==1)        {           tabla[i]=x;

               i++;        }    }                       for (x=0;x<i;x++)            {        printf("%d\n",tabla[x]);    }               system("PAUSE");         return 0;}

Page 10: Array bidimensional