elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 [7] 8
61  Programación / Ejercicios / Re: Ejercicios resueltos JAVA [programacion estructurada] en: 26 Febrero 2008, 18:41 pm
>> SERIES <<

Generar 5,10,15,20,25,30,...
Código:
class JavaSeries1
{
    public static void main (String args [])
    {
int n, c = 1, serie = 5;
System.out.print ("Cantidad d terminos: ");
n = Leer.datoInt ();
while (c <= n)
{
    System.out.print ("," + serie);
    serie += 5;
    c++;
}
    }
}

Si n=7  generar 7,6,5,4,3,2,1   
Código:
class JavaSeries2
{
    public static void main (String args [])
    {
int n, c = 1;
System.out.print ("Cantidad d terminos: ");
n = Leer.datoInt ();
int serie = n;
while (c <= n)
{
    System.out.print (serie + ",");
    serie--;
    c++;
}
    }
}
62  Programación / Ejercicios / Re: Ejercicios resueltos C++ [programacion estructurada] en: 26 Febrero 2008, 18:41 pm
>> SERIES <<

hallar la sumatoria de:   2! + 4! + 6! + 8! + ...
Código:
#include <stdio.h>
#include <conio.h>
int facto (int x)
{
     int f=1;
     for (int i=1;i<=x;i++)
     {f=f*i;}
     return (f);
}

int main ()
{
    int n, serie=2, suma=0;
    printf ("Inserte cantidad de terminos a generar: "); scanf ("%d",&n);
    for (int i=1;i<=n;i++)
    {
      printf ("%d! + ",serie);
      suma=suma+(facto(serie));
      serie=serie+2;
    }
    printf ("   = %d",suma);
    getch();
}


Generar la serie: 1, 5, 3, 7, 5, 9, 7, ..., 23
Código:
#include <stdio.h>
#include <conio.h>

int main ()
{
    int serie=1;
    bool sw=true;
    do
    {
      printf("%d, ",serie);
      if (sw) serie+=4;
      else serie-=2;
      sw=!sw;
    } while (serie<=23);
    getch();
}

Generar 5,10,15,20,25,30,35....n
Código:
#include<stdio.h>
#include<conio.h>
int main ()
{
 int n, c=1, serie=5;
 printf("Cantidad de terminos: ");
 scanf("%d",&n);
 while(c<=n)
 {
  printf("%d,",serie);
  serie+=5; c++;
 }
 getch();
}

Si n=7 generar 7,6,5,4,3,2,1
Código:
#include<stdio.h>
#include<conio.h>
int main ()
{
 int n, c=1;
 printf("Cantidad de terminos: ");
 scanf("%d",&n);
 int serie=n;
 while(c<=n)
 {
  printf("%d,",serie);
  serie--; c++;
 }
 getch();
}
63  Programación / Ejercicios / Ejercicios resueltos JAVA [programacion estructurada] en: 26 Febrero 2008, 18:40 pm
>> ARITMETICA <<

- Hallar A+B-C+100
Código:
class JavaAritmetica1
{
    public static void main (String mago [])
    {
int A, B, C;
System.out.print ("Inserte A: ");
A = Leer.datoInt ();
System.out.print ("Inserte B: ");
B = Leer.datoInt ();
System.out.print ("Inserte C: ");
C = Leer.datoInt ();
System.out.println ("\n" + A + " + " + " " + B + " - " + C + " + " + 100 + " = " + (A + B - C + 100));
    }
}

Hallar (a-b)(a+b)
Código:
class JavaAritmetica2
{
    public static void main (String elMago [])
    {
int a, b;
System.out.print ("Inserte valor a: ");
a = Leer.datoInt ();
System.out.print ("Inserte valor b: ");
b = Leer.datoInt ();
System.out.println ("(" + a + "-" + b + ") " + "(" + a + "+" + b + ") " + "= " + ((a - b) * (a + b)));
    }
}


Leer un numeo de tres digitos y sumarlos
Código:
class JavaAritmetica3
{
    public static void main (String elMago [])
    {
int numero, sumDig = 0;
System.out.print ("Inserte numero de tres digitos: ");
numero = Leer.datoInt ();
if (numero <= 100)
    System.out.println ("ERROR: El numero no tiene 3 digitos");
else
{
    int aux = numero; //en aux salvamos numero
    while (numero != 0)
    {
sumDig = sumDig + (numero % 10); //sumamos a sumDig el ultimo digito de numero
numero = numero / 10; //eliminamos el ultimo digito de numero
    }
    System.out.println ("La suma de los digitos de " + aux + " es: " + sumDig);
}
    }
}


Dado un numero verificar:
    - Que tenga dos digitos
    - Verificar si sus digitos son pares
    - Promediar sus digitos

Código:
class JavaAritmetica4
{
    public static void main (String args [])
    {
int numero;
System.out.print ("Inserte un numero de dos digitos pares: ");
numero = Leer.datoInt ();
int aux = numero;
if (numero < 100 && numero > 9)
{
    int d1 = numero % 10;
    numero = numero / 10;
    int d2 = numero % 10;
    if (d1 % 2 == 0 && d2 % 2 == 0)
System.out.println ("El promedio de los digitos de: " + aux + " es: " + ((d1 + d2) / 2));
}
    }
}


Dado un numero entero, determinar si es positivo, negativo o nulo
Código:
class JavaAritmetica5
{
    public static void main (String args [])
    {
int numero;
System.out.print ("Inserte un numero: ");
numero = Leer.datoInt ();
if (numero == 0)
    System.out.println ("El numero " + numero + " es NULO");
else
{
    if (numero < 0)
System.out.println ("El numero " + numero + " es NEGATIVO");
    else
System.out.println ("El numero " + numero + " es POSITIVO");
}

    }
}

Dados seis numero determinar el menor de ellos
Código:
class JavaAritmetica6
{
    public static void main (String args [])
    {
int a, b, c, d, e, f;
System.out.print ("Inserte num.1: ");
a = Leer.datoInt ();
System.out.print ("Inserte num.2: ");
b = Leer.datoInt ();
System.out.print ("Inserte num.3: ");
c = Leer.datoInt ();
System.out.print ("Inserte num.4: ");
d = Leer.datoInt ();
System.out.print ("Inserte num.5: ");
e = Leer.datoInt ();
System.out.print ("Inserte num.6: ");
f = Leer.datoInt ();
int menor = a;
if (b < menor)
    menor = b;
if (c < menor)
    menor = c;
if (d < menor)
    menor = d;
if (e < menor)
    menor = e;
if (f < menor)
    menor = f;
System.out.println ("\nEl menor de:" + a + "," + b + "," + c + "," + d + "," + e + "," + f + ",");
System.out.println ("Es: " + menor);
    }
}




64  Programación / Ejercicios / Ejercicios resueltos C++ [programacion estructurada] en: 26 Febrero 2008, 18:40 pm
>> ARITMETICA <<

Mostrar los multiplos de 3 comprendidos entre los numeros 1 y 20
Código:
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
int main ()
{
    clrscr();
    for (int i=1;i<=20;i++)
    {
cout<<i;
if (i%3==0) cout<<" Es multiplo de 3" <<endl;
else cout<<" No es multiplo de 3"<<endl;
    }
    getch();
    return 0;
}

Hallar A+B-C+100
Código:
#include <stdio.h>
#include <conio.h.>
int main ()
{
     int A, B, C;
     printf("Inserte valor para A: "); scanf("%d",&A);
     printf("Inserte valor para B: "); scanf("%d",&B);
     printf("Inserte valor para C: "); scanf("%d",&C);
     printf("\n%d + %d - %d + 100 = %d",A, B, C, (A+B+C-100));
     getch();
}

Obtener (a-b)(a+b)
Código:
#include <stdio.h>
#include <conio.h>
int main ()
{
    int a, b;
    printf("Inserte valor a: "); scanf("%d",&a);
    printf("Inserte valor b: "); scanf("%d",&b);
    printf("(%d-%d) (%d+%d) = %d",a, b, a, b,((a-b)*(a+b)));
    getch();
}


Leer un numero de 3 digitos y sumarlos
Código:
#include <stdio.h>
#include <conio.h>
int main ()
{
    int numero, sum_dig=0;
    printf("Inserte un numero de 3 digitos: "); scanf("%d",&numero);
    if (numero>=100)
    {
       int num=numero; //salvamos en num, la variable numero
       while (numero!=0)
       {
         sum_dig=sum_dig+(numero%10); //para sacar el ultimo digito de numero
         numero=numero/10; //elimina el ultimo digito de numero
       }
       printf("La suma de los digitos de %d es : %d",num, sum_dig);
    }
    else
    printf("\a ERROR: El digito no tiene 3 digitos");
    getch();
}

Dado un numero verificar:
    - Que tenga dos digitos
    - Verificar si sus digitos son pares
    - Promediar sus digitos

Código:
#include <stdio.h>
#include <conio.h>
int main ()
{
 int numero;
 printf("Inserte num. de dos digitos pares: ");
 scanf("%d",&numero);
 int aux=numero;
 if(numero<100 && numero>9)
 {
  int d1=numero%10;
  numero=numero/10;
  int d2=numero%10;
  if(d1%2==0 & d2%2==0)
   printf("El promedio d los digitos de %d es: %d",aux,(d1+d2)/2);
 }
 else
  printf("\aERROR: el numero no tiene dos digitos");
 getch();
}

Dado un numero verificar si es positivo, negativo o nulo
Código:
#include <stdio.h>
#include <conio.h>
int main ()
{
 int numero;
 printf("Inserte un numero: ");
 scanf("%d",&numero);
 if(numero==0)
  printf("El numero %d es NULO",numero);
 else
 {
  if(numero<0)
    printf("El numero %d es NEGATIVO",numero);
  else
    printf("El numero %d es POSITIVO",numero);
 }
 getch();
}

Dados seis numeros enteros determinar, el menor de ellos
Código:
#include<stdio.h>
#include<conio.h>
int main()
{
 int a, b, c, d, e, f;
 printf("Inserte num.1: "); scanf("%d",&a);
 printf("Inserte num.2: "); scanf("%d",&b);
 printf("Inserte num.3: "); scanf("%d",&c);
 printf("Inserte num.4: "); scanf("%d",&d);
 printf("Inserte num.5: "); scanf("%d",&e);
 printf("Inserte num.6: "); scanf("%d",&f);
 int menor=a;
 if(b<menor) menor=b;
 if(c<menor) menor=c;
 if(d<menor) menor=d;
 if(e<menor) menor=e;
 if(f<menor) menor=f;
 printf("El menor de %d,%d,%d,%d,%d,%d ",a,b,c,d,e,f);
 printf("\nEs %d",menor);
 getch();
}



65  Foros Generales / Foro Libre / Re: Sus escritorios en: 25 Febrero 2008, 20:17 pm
Aqui van los mios xD







66  Informática / Tutoriales - Documentación / Re: Índice de temas [13/01/08] en: 15 Febrero 2008, 16:57 pm
Citar
es la mejor recopilación que he visto
Pues si Hacker-Mate tiene razon es la mejor recopilacion de temas me gusta xD
67  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Los números de elhacker.net en: 30 Noviembre 2007, 14:15 pm
POz es la mejor web de informatica, hacking, programación, electronica, seguridad informatica, yo tambien quisiera tener mi web asi, esta super!  :)
68  Seguridad Informática / Seguridad / Re: Nueva encuesta: Mejor Antivirus en: 30 Noviembre 2007, 02:49 am
 :D Yeeeea!, aja oi voto por KIS, nada lo cambia, no tiene comparación es el angel de la guarda de una PC, jeje  ;D
69  Informática / Electrónica / Re: [Curso] Aprende electrónica desde cero en: 29 Noviembre 2007, 04:29 am
Sip meta tiene razon UNICROM.com es muy buena, aunk es mejor tener un libro, en la computadora pues vendria muy bien un programa " CIRCUIT MAKER ", es muy  bueno claro, para Windows XD  ::)
70  Informática / Electrónica / Re: Quiero Aprender Electronica en: 29 Noviembre 2007, 04:23 am
Sip!, lu8emw tiene razon mejor toma un libro io te recomiendo ==>
libro: Electrónica teoría de circuitos    de: Boylestad ::)
Es un magnifico libro compralo, tiene todo extremadamente detallado sobre electronica
Páginas: 1 2 3 4 5 6 [7] 8
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines