Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find max/min element using pointer is an interactive C dry run visualizer from the Pointersarrays 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>
void findMinMax(int *ptr, int n, int *min, int *max) {
int i;
*min = ptr[0];
*max = ptr[0];
for(i = 1; i < n; i++) {
if(*(ptr + i) < *min) {
*min = *(ptr + i);
}
if(*(ptr + i) > *max) {
*max = *(ptr + i);
}
}
}
int main() {
int i;
int arr[] = {45, 23, 89, 12, 67, 34, 91, 56};
int n = sizeof(arr)/sizeof(arr[0]);
int min, max;
findMinMax(arr, n, &min, &max);
printf("Array elements: ");
for(i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
printf("\nMinimum element: %d", min);
printf("\nMaximum element: %d", max);
return 0;
}