Reputation: 1
I'm trying to code a program that does the following: "Receives an input (N) and outputs an array with all hexadecimals with 'N'
Nibbles on ascending order."
To do this, I created a main function
int main () {
int n;
printf("Insert number of N");
scanf(%d,&n)
outhexdecimals(N);
return(0);
}
the function outhexdecimals will create an array based on the input value of n, arrange it in asceding ordem and then outputs the array.
Ex: N = 3;
000 , 002, 003, 004, 005, ..., FFF
My problem is: I don't know how to convert the decimal number to hex, that is, after '009'
, i do not know how to output the value '00A'
on the array.
Is there a way that I can do this by converting the decimal value?
Any help provided in this matter is greatly appreciated.
Thanks.
Upvotes: 0
Views: 391