Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Manual de Programas Netbeans
Manual de Programas Netbeans
System.out.println("Hola Mundo");
int x,y,res;
System.out.println("Primer Numero");
x=leer.nextInt();
System.out.println("Segundo Numero");
y=leer.nextInt();
res=x+y;
int x;
System.out.println("Introduzca su numero");
x=leer.nextInt();
if (x%2==0)
System.out.println("Numero par");
else
System.out.println("Numero impar");
int x;
System.out.println("Introducir Numero");
x=leer.nextInt();
if(x==0)
if(x<0)
else
int x,res;
System.out.println("Introduzca Numero");
x=leer.nextInt();
res=x*2;
6.-Programa que pide 2 números e imprime qué relación existe, mayor menor o iguales.
int x,y;
x=leer.nextInt();
y=leer.nextInt();
if(x==y)
if(x>y)
else
int x,res;
System.out.println("ingrese Numero");
x=leer.nextInt();
res=x*x;
double x,y,w,r1,r2,r3;
x=veer.nextInt();
y=veer.nextInt();
w=veer.nextInt();
r1=x+y;
r2=x+w;
r3=y+w;
if((r1==w)|(r2==y)|(r3==x))
else
int x,y,res;
x=leer.nextInt();
res=x/y;
double x,y,res;
x=leer.nextInt();
y=leer.nextInt();
res=x*y;
int x,r,r1,r2,r3,r4,r5;
x=leer.nextInt();
r=x/1000;
r1=x%1000;
r2=r1/100;
r3=r1%100;
r4=r3/10;
r5=r3%10;
/**
*/
double x,y,res;
y=.453;
x=leer.nextInt();
res=x/y;
System.out.println(x+ " libras"+ " es ="+ " a "+ res+ " Gramos");
}
double x,y,res;
x=leer.nextInt();
res=(x*1.8)+32;
double x,y;
System.out.println("Cantidad de centimetros");
x=leer.nextInt();
y=x/2.54;
}
15.-Programa que calcula el área de un triangulo
int x,y,res;
System.out.println("Introdusca la base");
x=leer.nextInt();
System.out.println("Introdusca la altura");
y=leer.nextInt();
res=(x*y)/2;
int x,fact,n;
fact=1;
System.out.println("Introdusca numero");
n=leer.nextInt();
for(x=n;x>0;x--){
fact=x*fact;
}
System.out.println("El factorial de tu numero es: "+ fact);
int x,y,z,r;
x=leer.nextInt();
y=leer.nextInt();
z=leer.nextInt();
r=(x*y)*z;
int x,r,r1,r2,r3,r4,r5,r6,r7;
x=leer.nextInt();
r=x%10;
r1=x/10;
r2=r1%10;
r3=x/100;
r4=r3%10;
r5=x/1000;
System.out.println(r);
System.out.println(r2);
System.out.println(r4);
System.out.println(r5);
double x,y,res;
y=1.60;
System.out.println("Introdusca millas");
x=leer.nextInt();
res=x*y;
}
}
double x,y,res;
y=1.60;
System.out.println("Introdusca Kilometros");
x=leer.nextInt();
res=x/y;
double x,y,res;
y=0.9144;
x=leer.nextInt();
res=x*y;
}
22.-Programa que imprime 5 veces tu nombre
int x;
for(x=1;x<6;x++){
System.out.println("Jorge" );
23.-Programa que imprime los números pares del 20 al 80 con ciclo for
int x,y;
for (x=18;x<=78;x++){
y=x+2;
System.out.println( y);
23.-Programa que imprime los números pares del 20 al 80 con ciclo while-mientras
public static void main(String[] args) {
int x,y;
x=18;
y=2;
while(x<80){
x=x+y;
System.out.println( x );
int x,y,res;
y=7;
for(x=1;x<=14;x++){
res=x*y;
System.out.println( res);
}
25.-Programa que imprime los múltiplos de 7 del 1-100. Cilco while-mientras
int x,y,res;
x=7;
y=1;
while(y<=14){
res=x*y;
y=y+1;
int x,y,res;
System.out.println("Introduzca un numero");
x=leer.nextInt();
for(y=1;y<=10;y++){
res=x*y;
int x,y,w,z;
x=0;
y=1;
w=1;
z=leer.nextInt();
System.out.println("OK");
System.out.println(x);
while(w<z){
System.out.println(y);
y=y+x;
x=y-x;
w++;
for(x=10;x<=20;x++){
System.out.println( x );
System.out.println("Numeros impares");
int i=19;
while(i<=77){
i=i+2;
System.out.println(i);
int x;
for(x=0;x<10;x++){
for(x=0;x<arreglo.length;x++){
int x,suma=0;
for(x=0;x<10;x++){
arreglo[x]=leer.nextInt();
suma=suma+arreglo[x];
double suma=0,prom=0;
int x;
for(x=0;x<10;x++){
arreglo[x]=leer.nextInt();
suma=suma+arreglo[x];
prom=suma/10;
int x,n,y,w=0;
x=leer.nextInt();
y=leer.nextInt();
for(n=x;x<=y;x++){
w=w+x;
}
}
int x,y,res;
x=leer.nextInt();
for(y=1;y<=10;y++){
res=x*y;
System.out.println("Listo");
35.-Programa que pide una serie de números del 1 hasta n, pidiendo hasta que valor quiere
imprimir
int x,y,n,r;
x=leer.nextInt();
for(y=1;y<=x;y++){
r=y;
System.out.println(+r);
}
}
36.-Programa que pide un numero y nos dice si es el numero mágico, el cual se encuentra en el
programa indicando si es mayor o menor.
int x,y=32;
System.out.println("introdusca un numero");
x=leer.nextInt();
if(x<y)
else if(x>y)
else if(x==y)
double x,y=3.1416,r,res;
x=leer.nextInt();
r=x*x;
res=r*y;
double x,y,res;
x=leer.nextInt();
res=x*60;
int x,y,res;
y=24;
x=leer.nextInt();
res=x*y;
int x,multi=1;
for(x=0;x<4;x++){
arreglo[x]=leer.nextInt();
multi=multi*arreglo[x];