Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find maximum circular rotation of a 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>
#include <math.h>
int main() {
int num, digits = 0, temp, i;
printf("Enter a number: ");
scanf("%d", &num);
for(temp = num; temp != 0; temp /= 10) {
digits++;
}
int divisor = pow(10, digits - 1);
int rotated = num;
int maxRotation = num;
for(i = 1; i < digits; i++) {
int lastDigit = rotated % 10;
rotated = lastDigit * divisor + (rotated / 10);
if(rotated > maxRotation) {
maxRotation = rotated;
}
}
printf("Maximum circular rotation = %d\n", maxRotation);
return 0;
}