I am wonder how do you make it that you have to letters = to one number with only typing it once? Here is my program. My problem is that the result printf("%d reversed is: %d\n",num , res); is 0 reversed is: (The number backwords).
#include <iostream>
#include <stdio.h>
#include "simpio.h"
#include "strlib.h"
#include "random.h"
using namespace std;
int main(void)
{
int num, res=0, rem;
printf("Please enter an integer: ");
num = GetInteger();
while(num > 0)
{
rem=num% 10;
res=res* 10 + rem;
num=num/10;
}
printf("%d reversed is: %d\n",num , res);
system("pause");
}