Skip to content

Instantly share code, notes, and snippets.

@brayancruces
Created August 29, 2014 20:39
Show Gist options
  • Save brayancruces/9d3ffc5428c373dd4652 to your computer and use it in GitHub Desktop.
Save brayancruces/9d3ffc5428c373dd4652 to your computer and use it in GitHub Desktop.
EJERCICIO 06 - C++
// EJERCICIO 06 - C++ UNIDAD
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int numero,m,c,d,u,numinvertido;
cout<<"ingrese un numero de 4 digitos";
cin>>numero;
m= numero/1000;
c = (numero % 1000)/100;
d = (numero%100) /10;
u = numero %10;
numinvertido= u*1000+d*100+c*10+m;
cout<<"El numero invertido es: "<<numinvertido;
_getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment