print_any_digit
Turn-in directory01_print_any_digit/
Files to turn inprint_any_digit.c
Allowed functionsputchar
  • Write a function which prints only the digit in the position specified by position of the unsigned integer num represented in the decimal numeral system.
  • The first position is represented by the value 0. Since the decimal numeral system has infinite positions, all positions always have a value! Even when you normally wouldn't print/write that value.
include <stdio.h>

void print_any_digit(unsigned int num, unsigned int position);

int main()
{
    print_any_digit(2839, 2);
    return 0;
}

Example output:

$ ./a.out
8$