MR PROGRAMATOR

Dígitos

/***********************************************************************/

/*    Nombre del programa : digitos.cpp                                */

/*    Autor :     Luis Alberto Saucedo Quiroga                         */

/*    Objetivo : Mostrar los dígitos por separado de un número entero  */

/*    Fecha : 24/04/2012                                               */

/***********************************************************************/

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])

{

      int N,r;

      printf("Ingrese un numero entero :");scanf_s("%d",&N);

      while(N>1)

      {

            r = N%10;

            printf("n%d",r);

            N =N/10;

      }

      printf("n%dn",N);

      return 0;

}


Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis