Program Console Vignaankosh.com
Execution Panel
Console is empty.
Check if a number contains a specific digit (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>
#include <stdbool.h>
bool containsDigit(int n, int target) {
if(n == 0) {
return false; // No digits left to check
}
if(n % 10 == target) {
return true; // Found the digit
}
return containsDigit(n / 10, target);
}
int main() {
int num = 48236;
int search = 8;
if(containsDigit(num, search))
printf("%d contains digit %d\n", num, search);
else
printf("%d does NOT contain digit %d\n", num, search);
return 0;
}