Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

decimal to binary

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

int main ()
{
    int i;
    char buffer [33];
    printf ("Enter a number: ");
    scanf ("%d",&i);
    itoa (i,buffer,10);
    printf ("decimal: %s
",buffer);
    itoa (i,buffer,16);
    printf ("hexadecimal: %s
",buffer);
    itoa (i,buffer,2);
    printf ("binary: %s
",buffer);
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #decimal #binary
ADD COMMENT
Topic
Name
7+9 =