Your image is loading...

28 agosto 2008

Programa para ordenar 3 numeros de Mayor a Menor

 

 

 

 

 

#include "stdio.h"
#include "stdlib.h"
main()
{
int N1;
int N2;
int N3;
     printf("\n");
                           printf("\n");
                                printf("\n");
                           printf("\n");
                           system ("color e");
     printf("       * PROGRAMA PARA ORDENAR TRES NUMEROS DE MAYOR A MENOR *\n");
      printf("\n");
      printf("\n");
printf("Digite un numero:\n");
scanf("%d",&N1);
printf("Digite otro numero:\n");
scanf("%d",&N2);
printf("Digite otro numero:\n");
scanf("%d",&N3);
if(N1<N2)
{
         if(N2<N3)
         {
                  if(N1<N3)
                  {
                           printf("\n");
                           printf("\n");
                           printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N3, N2, N1);
                           printf("\n");
                           printf("\n");
                           }else{}
                           }else{
                                 if(N1<N3)
                                 {
                                          printf("\n");
                                          printf("\n");
                                          printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N2, N3, N1);
                                          printf("\n");
                                          printf("\n");
                                          }else{
                                                printf("\n");
                                                printf("\n");
                                                printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N2, N1, N3);
                                                printf("\n");
                                                printf("\n");
                                                }
                                                }
                                                }else{
                                                      if(N1<N3)
                                                      {
                                                               printf("\n");
                                                               printf("\n");
                                                               printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N3, N1, N2);
                                                               printf("\n");
                                                               printf("\n");
                                                               }else{
                                                                     if(N2<N3)
                                                                     {
                                                                              printf("\n");
                                                                              printf("\n");
                                                                              printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N1, N3, N2);
                                                                              printf("\n");
                                                                              printf("\n");
                                                                              }else{
                                                                                    printf("\n");
                                                                                    printf("\n");
                                                                                    printf("Al ordenar los numeros de MAYOR a MENOR, queda asi: %d > %d > %d\n", N1, N2, N3);
                                                                                    printf("\n");
                                                                                    printf("\n");
                                                                                    }
                                                                                    }
                                                                                    }     printf("\n");
printf("\n");
printf("\n");

      printf ("            Realizado por: Alejandro Acevedo\n");
      printf ("            Contacto: alejo2004_2005@yahoo.es\n");
      printf ("            Si necesitas el codigo del programa, Enviar Correo\n");
      printf ("            con asunto < C++ >\n");

printf("\n");
printf("\n");
                                                                                    system("pause");
                                                                                    }

 

MAS EJERCICIOS C++

(Click en Imagen)

 

 

Si no te deja copiar el código mandame un correo a alejo2004_2005@yahoo.es con asunto "C++", y para no tener mas inconvenientes en la pagina no olvides hacer tu suscripcion completamente gratis....

0 comentarios:

Publicar un comentario

Gracias por participar en ♫ Estación MusiKal ♫, espero q dejes todos tus puntos de vista, sean bueno o malos, y recuerda afiliarte a la pagina para recibir directamente nuestras entradas en cu correo.

Add to Google Reader or HomepagePowered by FeedBurner

Para una óptima visualización sugerimos: Resolución 1024 x 768