How is function itoa() written in C?

Submitted by: Administrator
#include<stdlib.h>
#include<stdio.h>
int main()
{
int n = 6789;
char p[20];
itoa(n,s,10);
printf("n=%d,s=%s",n,s);
return 0;
}
Submitted by: Administrator

char buff[10];
int num_to_be_converted;
scanf("%d", &num_to_be_converted);
itoa(num_to_be_converted, buff, 10);
/* 10 is the base to be converted. it can range from 2 to 32 ..*/

The converted result is stored in string buff.
Submitted by: Aditya

Read Online Embedded Systems Job Interview Questions And Answers