Nuevas NORMAS para el foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Julio 26, 2008, 12:35:29
Boton Buscar
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: NUMEROS PERFECTOS EN UN RANGO CODIFICADO EN C 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: NUMEROS PERFECTOS EN UN RANGO CODIFICADO EN C  (Leído 1133 veces)
J@Ker Lo10
Habitual
*****
Desconectado Desconectado

Mensajes: 200


'LA PRimeR @ VivE' J @Ker LOlo

???? ???? ????
Ver Perfil
« en: Abril 12, 2005, 11:28:54 »

//ESTE PROGRAMA IMPRIME LOS NUMEROS PERFECTOS
//EN KE HAY EN UN RANGO DADO

jaker_lolo @hotmail.com

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void pseudocodigo(void);
void main(void)
{
 int A,B;
 int div,suma;
 int i=0;
 clrscr();
 pseudocodigo();
 gotoxy(25,22);printf("Dame el valor inicial:");
 scanf("%d",&A);
 gotoxy(25,23);printf("Dame el valor final..:");
 scanf("%d",&B);
 printf("\n\t\t\t\t");
 for(int N=A;N<=B;N++)
    {
      suma=0;
      div=N-1;

     while(div!=0)
    {
    if((N%div)==0)
       {
       suma=suma+div;
       }
       div=div-1;
    }
      if(suma==N)
   {
   i=i+1;
   printf("%d,",N);

   }
    }
    if(i==0)
      {
    gotoxy(18,26);printf("No hay numeros perfectos en el rango de %d-%d",A,B);
      }
getch();
}










//FUNCION DEL PSEUDOCODIGO
void pseudocodigo(void)
{
 gotoxy(45,48);printf("Autor:Dolores Martinez Santiago");
 gotoxy(25,2);printf("          PSEDOCODIGO");
 gotoxy(25,4);printf("-Inicio");
 gotoxy(25,5);printf("-Leer Numero:");
 gotoxy(25,6);printf("-Mientras divisor<>0 hacer:");
 gotoxy(25,7);printf("          -Si(Numero mod divisor)=0 entonces:");
 gotoxy(25,8);printf("             suma=suma+divisor:");
 gotoxy(25,9);printf("           fin si");
 gotoxy(25,10);printf("          divisor=divisor-1");
 gotoxy(25,11);printf(" fin del mientras");
 gotoxy(25,12);printf("-Si(suma=Numero) entonces");
 gotoxy(25,13);printf("    imprimr Numero");
 gotoxy(25,14);printf(" fin si");
 gotoxy(25,15);printf("-Fin");
}
En línea

El ConoCIMIenTo no lleGA poR si solo,
soLO kE el MEdio pARA oBteNERlo es ..........
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: NUMEROS PERFECTOS EN UN RANGO CODIFICADO EN C « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.5 | SMF © 2006-2007, Simple Machines LLC