Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find smallest digit in a number (Recursion) is an interactive C dry run visualizer from the Recursion programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.
This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.
#include <stdio.h>
int smallestDigit(int n) {
if(n < 10) {
return n;
}
int lastDigit = n % 10;
int minInRest = smallestDigit(n / 10);
return (lastDigit < minInRest) ? lastDigit : minInRest;
}
int main() {
int num = 739582;
int result = smallestDigit(num);
printf("Number: %d\n", num);
printf("Smallest digit = %d\n", result);
return 0;
}