print_first_digit
| print_first_digit | |
|---|---|
| Turn-in directory | 00_print_first_digit/ |
| Files to turn in | print_first_digit.c |
| Allowed functions | putchar |
- Write a function which prints only the first digit of the unsigned integer
numrepresented in the decimal numeral system. - Decimal Numeral System as explained by Wikipedia
include <stdio.h>
void print_first_digit(unsigned int num);
int main()
{
print_first_digit(39);
return 0;
}
Example output:
$ ./a.out
9$