SlideShare une entreprise Scribd logo
1  sur  4
UNIVERSIDAD NACIONAL DE CHIMBORAZO
FACULTAD DE CIENCIAS DE LA EDUCACION HUMANAS Y
TECNOLOGIAS
NOMBRE: GEOVANNY YUNGAN
PRACTICA 10
EJERCICIO 1
1.- utilizando ventores convertir un numero decimal a binario y octal.
//GEOVANNY YUNGAN
package ASpractica10;
import java.util.Scanner;
class binario_octal {
public static void main(String arg [])
{
int i,n,d,x,bin,oc,j ;
Scanner datos=new Scanner (System.in);
int [] binar=new int [100];
int [] octa=new int [100];
System.out.println("= TRANFORMACION DE UN NUMERO DECIMAL A OCTAL Y BINARIO = ");
System.out.print("Ingrese el numero a transformar: ");
n=datos.nextInt();
j=0;
d=n;
x=n;
System.out.print(" El Numero Binario es: ");
while(d!=0)
{
bin=d%2;
d=d/2;
binar[j]=bin;
j++;
}
for(i=j-1;i>=0;i--)
{
System.out.print( binar[i]);
}
System.out.println();
System.out.print("El Numero Octal es: ");
j=0;
while(x!=0)
{
oc=x%8;
octa[j]=oc;
x=x/8;
j++;
}
for(i=j-1;i>=0;i--)
{
System.out.print(octa[i]);
}
}
}
EJECUCION
EJERCICIO 2
2.- ingrese un vector de n elementos y en un vector resultante coloque solo los
elementos que se repiten.
//GEOVANNY YUNGAN
package ASpractica10;
import java.util.Scanner;
class elementos_repetidos {
public static void main(String arg [])
{
Scanner datos=new Scanner (System.in);
int i,n,j,m;
int [] v=new int [100];
int [] v1=new int [100];
m=0;
System.out.println("***OBTENER LOS NUMEROS REPETIDOS DEL PRIMER VECTOR*n");
System.out.println("***INGRESE LA DIMENSION DEL VECTOR***n");
n=datos.nextInt();
for(i=0;i<n;i++)
{
System.out.println("====INGRESE EL NUMERO DEL VECTOR***:n");
v[i]=datos.nextInt();
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(v[i]==v[j])
{
v1[m]=v[i];
m++;
}
}
}
System.out.println(" ** EL VECTOR RESULTANTE ES:**n");
for(i=0;i<m;i++)
{
System.out.println(" "+v1[i]);
System.out.println("n");
}
}
}
EJECUCION
Practica10

Contenu connexe

Tendances (18)

Practica 2
Practica 2Practica 2
Practica 2
 
Algoritmo Salida Y Entrada
Algoritmo  Salida Y EntradaAlgoritmo  Salida Y Entrada
Algoritmo Salida Y Entrada
 
Bucles y switch
Bucles y switchBucles y switch
Bucles y switch
 
Vector
Vector Vector
Vector
 
Practica 9
Practica 9Practica 9
Practica 9
 
11
1111
11
 
Practica12
Practica12Practica12
Practica12
 
Practica 12
Practica 12Practica 12
Practica 12
 
ESTRUCTURA DE DATOS ALEXIS ROJAS
ESTRUCTURA DE DATOS  ALEXIS ROJASESTRUCTURA DE DATOS  ALEXIS ROJAS
ESTRUCTURA DE DATOS ALEXIS ROJAS
 
Mostrar valor menor
Mostrar valor menorMostrar valor menor
Mostrar valor menor
 
Mostrar valor mayor
Mostrar valor mayorMostrar valor mayor
Mostrar valor mayor
 
Simulación - Algoritmo lineal
Simulación - Algoritmo linealSimulación - Algoritmo lineal
Simulación - Algoritmo lineal
 
UNIDAD III - ACTIVIDAD VI
UNIDAD III - ACTIVIDAD VIUNIDAD III - ACTIVIDAD VI
UNIDAD III - ACTIVIDAD VI
 
14
1414
14
 
Ap05
Ap05Ap05
Ap05
 
Programa Suma y Multiplicacion UFT
Programa Suma y Multiplicacion UFTPrograma Suma y Multiplicacion UFT
Programa Suma y Multiplicacion UFT
 
Programa suma y multiplica
Programa suma y multiplicaPrograma suma y multiplica
Programa suma y multiplica
 
Práctico 5 Derivadas
Práctico 5 DerivadasPráctico 5 Derivadas
Práctico 5 Derivadas
 

En vedette

Empowering rwandan communities one step at a time
Empowering rwandan communities one step at a timeEmpowering rwandan communities one step at a time
Empowering rwandan communities one step at a timecarerwandadoc
 
해바라기지역아동센터 소개
해바라기지역아동센터 소개해바라기지역아동센터 소개
해바라기지역아동센터 소개현숙 남
 
Technical brief1 final3
Technical brief1 final3Technical brief1 final3
Technical brief1 final3carerwandadoc
 
malnourishment in poor and healthy eating habits
malnourishment in poor and healthy eating habitsmalnourishment in poor and healthy eating habits
malnourishment in poor and healthy eating habitsHarsh Gupta
 
Redemption process flow
Redemption process flowRedemption process flow
Redemption process flowSurendra Nagar
 
Micromatic Company Overview Short Version
Micromatic Company Overview Short VersionMicromatic Company Overview Short Version
Micromatic Company Overview Short Versiongsank79
 

En vedette (12)

Morrison valley
Morrison valleyMorrison valley
Morrison valley
 
My sql workbench
My sql workbench My sql workbench
My sql workbench
 
Mudraganam Chandrashekar Profile
Mudraganam Chandrashekar ProfileMudraganam Chandrashekar Profile
Mudraganam Chandrashekar Profile
 
Empowering rwandan communities one step at a time
Empowering rwandan communities one step at a timeEmpowering rwandan communities one step at a time
Empowering rwandan communities one step at a time
 
해바라기지역아동센터 소개
해바라기지역아동센터 소개해바라기지역아동센터 소개
해바라기지역아동센터 소개
 
Eatern teaberry
Eatern teaberryEatern teaberry
Eatern teaberry
 
Technical brief1 final3
Technical brief1 final3Technical brief1 final3
Technical brief1 final3
 
Practica 5
Practica 5Practica 5
Practica 5
 
malnourishment in poor and healthy eating habits
malnourishment in poor and healthy eating habitsmalnourishment in poor and healthy eating habits
malnourishment in poor and healthy eating habits
 
Redemption process flow
Redemption process flowRedemption process flow
Redemption process flow
 
Micromatic Company Overview Short Version
Micromatic Company Overview Short VersionMicromatic Company Overview Short Version
Micromatic Company Overview Short Version
 
Surendra
SurendraSurendra
Surendra
 

Similaire à Practica10 (20)

Practica 9
Practica 9Practica 9
Practica 9
 
Practica 9
Practica 9Practica 9
Practica 9
 
Practica9
Practica9Practica9
Practica9
 
Practica 9
Practica 9Practica 9
Practica 9
 
Cecytem
CecytemCecytem
Cecytem
 
Ejercicios resueltos de programacion
Ejercicios resueltos de programacionEjercicios resueltos de programacion
Ejercicios resueltos de programacion
 
Ejercicios resueltos de programacion
Ejercicios resueltos de programacionEjercicios resueltos de programacion
Ejercicios resueltos de programacion
 
Practica 9
Practica 9Practica 9
Practica 9
 
10
1010
10
 
Practica 8
Practica 8Practica 8
Practica 8
 
Practica 8
Practica 8Practica 8
Practica 8
 
Practica8
Practica8Practica8
Practica8
 
Practica 8
Practica 8Practica 8
Practica 8
 
Recuperacion programas
Recuperacion programasRecuperacion programas
Recuperacion programas
 
13
1313
13
 
Ejercicio 5
Ejercicio 5Ejercicio 5
Ejercicio 5
 
Programa en java con el Metodo de la burbuja
Programa en java con el Metodo de la burbujaPrograma en java con el Metodo de la burbuja
Programa en java con el Metodo de la burbuja
 
Recuperacion programas
Recuperacion programasRecuperacion programas
Recuperacion programas
 
Bucles compuestos ejercicios en código java
Bucles compuestos ejercicios en código javaBucles compuestos ejercicios en código java
Bucles compuestos ejercicios en código java
 
Ejercicio 5
Ejercicio 5Ejercicio 5
Ejercicio 5
 

Plus de Geovanny Yungán (20)

Sibalo final
Sibalo finalSibalo final
Sibalo final
 
Sibalo
SibaloSibalo
Sibalo
 
Matemáticas
Matemáticas Matemáticas
Matemáticas
 
Artesanía de-la-ciudad-de-riobamba
Artesanía de-la-ciudad-de-riobamba Artesanía de-la-ciudad-de-riobamba
Artesanía de-la-ciudad-de-riobamba
 
Geovanny yungan (18)
Geovanny yungan (18)   Geovanny yungan (18)
Geovanny yungan (18)
 
Geovanny yungan (17)
Geovanny yungan (17) Geovanny yungan (17)
Geovanny yungan (17)
 
Geovanny yungan (16)
Geovanny yungan (16)  Geovanny yungan (16)
Geovanny yungan (16)
 
Geovanny yungan
Geovanny yungan Geovanny yungan
Geovanny yungan
 
Geovanny yungan redes
Geovanny yungan redesGeovanny yungan redes
Geovanny yungan redes
 
Geovanny yungan (14)
Geovanny yungan (14) Geovanny yungan (14)
Geovanny yungan (14)
 
Geovanny yungan (13)
Geovanny yungan (13) Geovanny yungan (13)
Geovanny yungan (13)
 
Geovanny yungan (12)
Geovanny yungan (12)Geovanny yungan (12)
Geovanny yungan (12)
 
Geovanny yungan (11)
Geovanny yungan (11)Geovanny yungan (11)
Geovanny yungan (11)
 
Geovanny yungan (10)
Geovanny yungan (10)   Geovanny yungan (10)
Geovanny yungan (10)
 
Geovanny yungan (9)
Geovanny yungan (9)Geovanny yungan (9)
Geovanny yungan (9)
 
Geovanny yungan (8)
Geovanny yungan (8)Geovanny yungan (8)
Geovanny yungan (8)
 
Geovanny yungan (7)
Geovanny yungan (7)  Geovanny yungan (7)
Geovanny yungan (7)
 
Geovanny yungan (6)n
Geovanny yungan (6)n  Geovanny yungan (6)n
Geovanny yungan (6)n
 
Geovanny yungan (5)
Geovanny yungan (5) Geovanny yungan (5)
Geovanny yungan (5)
 
Geovanny yungan (4)
Geovanny yungan (4)  Geovanny yungan (4)
Geovanny yungan (4)
 

Dernier

Planificacion Anual 4to Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 4to Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 4to Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 4to Grado Educacion Primaria 2024 Ccesa007.pdfDemetrio Ccesa Rayme
 
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdfDemetrio Ccesa Rayme
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptxFelicitasAsuncionDia
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAEl Fortí
 
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...JAVIER SOLIS NOYOLA
 
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARO
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARONARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARO
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFAROJosé Luis Palma
 
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIA
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIARAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIA
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIACarlos Campaña Montenegro
 
Dinámica florecillas a María en el mes d
Dinámica florecillas a María en el mes dDinámica florecillas a María en el mes d
Dinámica florecillas a María en el mes dstEphaniiie
 
Lecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadLecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadAlejandrino Halire Ccahuana
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdfgimenanahuel
 
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxzulyvero07
 
la unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscala unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscaeliseo91
 
programa dia de las madres 10 de mayo para evento
programa dia de las madres 10 de mayo  para eventoprograma dia de las madres 10 de mayo  para evento
programa dia de las madres 10 de mayo para eventoDiegoMtsS
 
Informatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosInformatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosCesarFernandez937857
 
Identificación de componentes Hardware del PC
Identificación de componentes Hardware del PCIdentificación de componentes Hardware del PC
Identificación de componentes Hardware del PCCesarFernandez937857
 
RETO MES DE ABRIL .............................docx
RETO MES DE ABRIL .............................docxRETO MES DE ABRIL .............................docx
RETO MES DE ABRIL .............................docxAna Fernandez
 
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Carlos Muñoz
 

Dernier (20)

Planificacion Anual 4to Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 4to Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 4to Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 4to Grado Educacion Primaria 2024 Ccesa007.pdf
 
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
 
Unidad 3 | Metodología de la Investigación
Unidad 3 | Metodología de la InvestigaciónUnidad 3 | Metodología de la Investigación
Unidad 3 | Metodología de la Investigación
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptx
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
 
Power Point: "Defendamos la verdad".pptx
Power Point: "Defendamos la verdad".pptxPower Point: "Defendamos la verdad".pptx
Power Point: "Defendamos la verdad".pptx
 
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
 
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARO
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARONARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARO
NARRACIONES SOBRE LA VIDA DEL GENERAL ELOY ALFARO
 
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIA
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIARAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIA
RAIZ CUADRADA Y CUBICA PARA NIÑOS DE PRIMARIA
 
Dinámica florecillas a María en el mes d
Dinámica florecillas a María en el mes dDinámica florecillas a María en el mes d
Dinámica florecillas a María en el mes d
 
Lecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadLecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdad
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf
 
Sesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdfSesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdf
 
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
 
la unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fiscala unidad de s sesion edussssssssssssssscacio fisca
la unidad de s sesion edussssssssssssssscacio fisca
 
programa dia de las madres 10 de mayo para evento
programa dia de las madres 10 de mayo  para eventoprograma dia de las madres 10 de mayo  para evento
programa dia de las madres 10 de mayo para evento
 
Informatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos BásicosInformatica Generalidades - Conceptos Básicos
Informatica Generalidades - Conceptos Básicos
 
Identificación de componentes Hardware del PC
Identificación de componentes Hardware del PCIdentificación de componentes Hardware del PC
Identificación de componentes Hardware del PC
 
RETO MES DE ABRIL .............................docx
RETO MES DE ABRIL .............................docxRETO MES DE ABRIL .............................docx
RETO MES DE ABRIL .............................docx
 
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
Plan Refuerzo Escolar 2024 para estudiantes con necesidades de Aprendizaje en...
 

Practica10

  • 1. UNIVERSIDAD NACIONAL DE CHIMBORAZO FACULTAD DE CIENCIAS DE LA EDUCACION HUMANAS Y TECNOLOGIAS NOMBRE: GEOVANNY YUNGAN PRACTICA 10 EJERCICIO 1 1.- utilizando ventores convertir un numero decimal a binario y octal. //GEOVANNY YUNGAN package ASpractica10; import java.util.Scanner; class binario_octal { public static void main(String arg []) { int i,n,d,x,bin,oc,j ; Scanner datos=new Scanner (System.in); int [] binar=new int [100]; int [] octa=new int [100]; System.out.println("= TRANFORMACION DE UN NUMERO DECIMAL A OCTAL Y BINARIO = "); System.out.print("Ingrese el numero a transformar: "); n=datos.nextInt(); j=0; d=n; x=n; System.out.print(" El Numero Binario es: "); while(d!=0) { bin=d%2; d=d/2; binar[j]=bin; j++; } for(i=j-1;i>=0;i--) { System.out.print( binar[i]); } System.out.println(); System.out.print("El Numero Octal es: "); j=0; while(x!=0) { oc=x%8;
  • 2. octa[j]=oc; x=x/8; j++; } for(i=j-1;i>=0;i--) { System.out.print(octa[i]); } } } EJECUCION EJERCICIO 2 2.- ingrese un vector de n elementos y en un vector resultante coloque solo los elementos que se repiten. //GEOVANNY YUNGAN package ASpractica10; import java.util.Scanner; class elementos_repetidos { public static void main(String arg []) { Scanner datos=new Scanner (System.in); int i,n,j,m; int [] v=new int [100]; int [] v1=new int [100]; m=0; System.out.println("***OBTENER LOS NUMEROS REPETIDOS DEL PRIMER VECTOR*n"); System.out.println("***INGRESE LA DIMENSION DEL VECTOR***n"); n=datos.nextInt(); for(i=0;i<n;i++) { System.out.println("====INGRESE EL NUMERO DEL VECTOR***:n"); v[i]=datos.nextInt();
  • 3. } for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(v[i]==v[j]) { v1[m]=v[i]; m++; } } } System.out.println(" ** EL VECTOR RESULTANTE ES:**n"); for(i=0;i<m;i++) { System.out.println(" "+v1[i]); System.out.println("n"); } } } EJECUCION