itoa() example
#include <stdio.h>
#include <stdlib.h>
void main ()
{
int no;
char c[33];
printf("Enter an integer number: ");
scanf("%d",&no);
itoa(no,c,10);
printf("decimal form of the string is: %s\n",c);
itoa(no,c,16);
printf("hexadecimal form of the string is: %s\n",c);
itoa(no,c,2);
printf("binary form of the string is: %s\n",c);
}
put output in the comment box...
The Value of nois 11111
The Value in Binary is 10101101100111
The Value in Decimal is 11111
The Value in Hexadecimal is 2b67
Enter an integer number: 23232
ReplyDeletedecimal from of the string is: 23232
hexadecimal from of the string is : 5ac0
binary from of the string is: 101101011000000