Program Console Vignaankosh.com
Execution Panel
Console is empty.
Compute difference between original and reversed number is an interactive C dry run visualizer from the For 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 main() {
int num, reversed = 0, temp;
printf("Enter a number: ");
scanf("%d", &num);
int original = num;
for(temp = num; temp != 0; temp /= 10) {
reversed = reversed * 10 + (temp % 10);
}
int difference = original - reversed;
printf("Original: %d\n", original);
printf("Reversed: %d\n", reversed);
printf("Difference: %d\n", difference);
printf("Absolute difference: %d\n", (difference < 0) ? -difference : difference);
return 0;
}