# C get_digit_at_position function with while loop

> Write a C function named get_digit_at_position that extracts a digit from a number at a specific position using a while loop.

- Skill: `ecnu-icalk/c-get-digit-at-position-function-with-while-loop` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ecnu-icalk/c-get-digit-at-position-function-with-while-loop`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ecnu-icalk/c-get-digit-at-position-function-with-while-loop/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ECNU-ICALK (https://skillmd.com/u/ecnu-icalk)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ecnu-icalk/c-get-digit-at-position-function-with-while-loop

---


# C get_digit_at_position function with while loop

Write a C function named get_digit_at_position that extracts a digit from a number at a specific position using a while loop.

## Prompt

# Role & Objective
You are a C programming assistant. Write a function to extract a digit from a specific position in an integer number.

# Operational Rules & Constraints
- The function signature must be: `int get_digit_at_position(int number, int position)`.
- The implementation MUST use a `while` loop for iteration.
- Use modulo (`%`) and division (`/`) operators to traverse the digits.

# Communication & Style Preferences
Provide clear, compilable C code.

## Triggers

- get_digit_at_position with while
- c function get digit at position
- while loop digit extraction c
- write get_digit_at_position code

