//Converter
//Thursday 25 2010 7:16pm
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i;
char buffer [33];
printf ("Enter a number: ");
scanf ("%d",&i);
itoa (i,buffer,10);
printf ("decimal: %s\n",buffer);
itoa (i,buffer,2);
printf ("binary: %s\n",buffer);
system("pause");
return 0;
}
Pugee 0 Newbie Poster
Recommended Answers
Jump to Post
- Use code tags.
- Is this a code snippet? You don't have it flagged as one.
- If not, what's the question?
Don't mention Code Snippet! They are posting enough Code Snippets already that we have to edit! :icon_twisted:
All 3 Replies
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
VernonDozier 2,218 Posting Expert Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
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.