Can anyone please help me reverse the output. This is just a very simple code and the output needs to be reversed in order for it to be correct.
#include <iostream>
#include "stdafx.h"
using std::cout;
using std::endl;
int _tmain(int argc, _TCHAR* argv[])
{
int num = 0;
int bin = 0;
cout << "Please enter a number to be converted to binary:";
std::cin >> num;
while (num != 0)
{
bin = num%2;
cout << bin;
num = num/2;
}
cout << endl;
system("PAUSE");
return 0;
}
BTW, i tried the search - i couldnt understand anything. Im sorry if im too much of a bother please bear with me.