Y
Yammy Hung
How to print out an integer (int) in C language without using printf()?
Thanks in advance!
Thanks in advance!
Your question stinks of cheating by asking someone else to do your
homework, but what the hell ...
#include <stdio.h>
void putint(int x);
int main(void)
{
puts("[output]");
putint(13725);
putchar('\n');
putint(5500);
putchar('\n');
return 0;
}
void putint(int x)
{
if (x) {
putint(x / 10);
putchar('0' + x % 10);
}
}
[output]
13725
5500
Yammy said:How to print out an integer (int) in C language without using printf()?
Thanks in advance!
Yammy said:How to print out an integer (int) in C language without using printf()?
Thanks in advance!
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.