I have designed a programme that allows you to enter a number wich is then displayed in various forms however I am stuck with the code to convert the entered number into text can someone help?

Below is what I have so far

#include <stdio.h>
#include <stdlib.h>
#include <iostream>

using namespace std;


int main ()
{
  int i;
  char str;
  char buffer [33];
  printf ("Enter a number: ");
  scanf ("%d",&i);
  itoa (i,buffer,10);
  printf ("decimal: %s\n",buffer);
  itoa (i,buffer,16);
  printf ("hexadecimal: %s\n",buffer);
  itoa (i,buffer, 2);
  printf ("binary: %s\n",buffer);


  system("pause");
  return 0;

}

Here's another similar thread that may give you some ideas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.