expo c i

9
ARREGLO BIDIMENSIONAL UNIVERSIDAD FERMIN TORO FACULTAD DE INGENIERIA CABUDARE ESTADO LARA ALUMNO: ERNESTO SANDOVAL 18.054.539 COMPUTACION PARA INGENIEROS FEBRERO; 2015

Upload: uftsaia

Post on 09-Aug-2015

9 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Expo c i

ARREGLO BIDIMENSIONAL

UNIVERSIDAD FERMIN TOROFACULTAD DE INGENIERIACABUDARE ESTADO LARA

ALUMNO:ERNESTO SANDOVAL

18.054.539COMPUTACION PARA

INGENIEROS

FEBRERO; 2015

Page 2: Expo c i

#include<stdio.h>#include<conio.h>#include<stdlib.h>int main() {

printf("[ACTIVIDAD 2]\n\n Introducir los valores a los elementos de la matriz\n\n");

int matriz[2][2],x=2,i=0,j=0,valor,cs=0,cn=0; for (i=0;i<x;i++) {

for (j=0;j<x;j++) {

printf("Lugar en la Matriz[%d %d]:",i+1,j+1); scanf("%d",&matriz[i][j]);

}} system("cls");printf("escriba el número a buscar dentro de la matriz:");

scanf("%d",&valor);for (i=0;i<x;i++) {

for (j=0;j<x;j++) {

if (matriz[i][j] == valor) {

cs=cs+1;}else

cn=cn+1;}

}//hacemos un condicional a mostrar el mensaje de si existe

ese valor en la matrizif (cs > 0 ) {

printf("\nEl elemento Si se encuentra en la Matriz Generada\n");

}else{matriz

printf("\nEl elemento No se encuentra en la Matriz Generada\n");

} printf("\nMatriz Generada:\n");

for (i=0;i<x;i++) {

for (j=0;j<x;j++) {

printf("| %d ",matriz[i][j]);}printf("|\n");

}getch();return 0;

}

Page 3: Expo c i
Page 4: Expo c i
Page 5: Expo c i
Page 6: Expo c i
Page 7: Expo c i
Page 8: Expo c i
Page 9: Expo c i

GRACIAS…!