Codigos

Solo disponible en BuenasTareas
  • Páginas : 2 (364 palabras )
  • Descarga(s) : 0
  • Publicado : 15 de septiembre de 2010
Leer documento completo
Vista previa del texto
EJER5
package javaapplication2;
import java.io.*;
public class ejer5 {
public static void main(String[] args)throws IOException {
BufferedReader obj=new BufferedReader(newInputStreamReader(System.in));
int i,ct,term;
System.out.println("cantidad de terminos");
ct=Integer.parseInt(obj.readLine());
for(i=1;i<=ct;i++){
if(i%2==0){
term=i/2;}else{
term=i*2;}
System.out.println("escribir terminos"+term);
}
}
}

EJER6
package javaapplication2;
import java.io.*;
public class ejer6 {
public staticvoid main(String[] args)throws IOException {
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
int i,n,r;
System.out.println("ingresar numero");n=Integer.parseInt(obj.readLine());
for(i=1;i<=12;i++){
r=n*i;
System.out.println("resultado"+r);

}
}
}

EJER7
ackage javaapplication2;
import java.io.*;public class ejer7 {
public static void main(String[] args)throws IOException {
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
int i,n,j,nr;System.out.println("escribir numero");
n=Integer.parseInt(obj.readLine());
for(i=1;i<=n;i++){
for(j=1;j<=12;j++){
nr=i*j;
System.out.println(nr);
}
}
}
}

EJER8
packagejavaapplication2;
import java.io.*;
public class ejer8 {
public static void main(String[] args)throws IOException {
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));
String nomb;
inti,ca=0,cd=0,cv=0,cm=0;
double n1,n2,p,sumap=0,pg;
char sexo;
for(i=1;i<=25;i++){
System.out.println("ingresar nombre");
nomb=obj.readLine();
System.out.println("ingresarprimer numero");
n1=Integer.parseInt(obj.readLine());
System.out.println("ingresar segundo numero");
n2=Integer.parseInt(obj.readLine());
System.out.println("ingresar sexo");...
tracking img