Program Console Vignaankosh.com
Execution Panel
Console is empty.
Evaluate number properties using while-based nested loops (while) is an interactive C dry run visualizer from the Nested 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 limit;
printf("Enter limit: ");
scanf("%d", &limit);
printf("\nNumber\tDivisors\tSum\tClassification\n");
printf("------\t---------\t---\t-------------\n");
int num = 1;
while(num <= limit) {
// Count divisors and calculate sum using while loop
int count = 0;
int sum = 0;
int i = 1;
while(i <= num) {
if(num % i == 0) {
count++;
sum += i;
}
i++;
}
// Determine classification
int properSum = sum - num;
char* classification;
if(properSum == num) classification = "PERFECT";
else if(properSum > num) classification = "ABUNDANT";
else classification = "DEFICIENT";
printf("%d\t%d\t\t%d\t%s\n", num, count, sum, classification);
num++;
}
return 0;
}