Program Console Vignaankosh.com
Execution Panel
Console is empty.
Repeat program until user exits is an interactive C dry run visualizer from the While 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 choice, num, sum;
do {
printf("\n===== MENU =====\n");
printf("1. Sum of digits\n");
printf("2. Reverse number\n");
printf("3. Check even/odd\n");
printf("4. Exit\n");
printf("Enter choice: ");
scanf("%d", &choice);
switch(choice) {
case 1:
printf("Enter number: ");
scanf("%d", &num);
sum = 0;
int temp = num;
while(temp > 0) {
sum += temp % 10;
temp /= 10;
}
printf("Sum of digits of %d = %d\n", num, sum);
break;
case 2:
printf("Enter number: ");
scanf("%d", &num);
int rev = 0;
temp = num;
while(temp > 0) {
rev = rev * 10 + (temp % 10);
temp /= 10;
}
printf("Reverse of %d = %d\n", num, rev);
break;
case 3:
printf("Enter number: ");
scanf("%d", &num);
if(num % 2 == 0)
printf("%d is even\n", num);
else
printf("%d is odd\n", num);
break;
case 4:
printf("Goodbye! Exiting program...\n");
break;
default:
printf("Invalid choice! Try again.\n");
}
} while(choice != 4);
return 0;
}