What is a c program to reverse a five digit number?

#include <iostream>

#include <string>

using std::cin;

using std::cout;

using std::endl;

using std::string;

int main()

{

const int numberOfDig = 5;

string num = "0";

cout << endl << "Enter a five digit number: ";

cin >> num;

string revNum = "00000";

for (int i = 0; i < numberOfDig; i++)

{

revNum[numberOfDig - i - 1] = num[i];

}

cout << endl << "You have entered: " << num

<< endl << "Reversed number is: " << revNum

<< endl;

system("PAUSE");

return 0;

}

OR a much simpler (not perfect) newbie method would be

#include<stdio.h>

#include<conio.h>

int main()

{

clrscr();

int a,b,c,d,e,f,g,i,h;

printf("enter a number");

//i supposed tht given numbers are vwxyz

scanf("%d",&a); //vwxyz

b=a/10000; //v

c=a%10000; //wxyz

d=c/1000; //w

e=c%1000; //xyz

f=e/100; //x

g=e%100; //yz

h=g/10; //y

i=g%10; //z

printf("reversed stuff is %d%d%d%d%d",i,h,f,d,b); //output is zyxwv

getch();

}