Program Console Vignaankosh.com
Execution Panel
Console is empty.
Use pointer as function argument is an interactive C dry run visualizer from the Pointersfunctions 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>
// Function that returns multiple values via pointers
void getMinMax(int *arr, int size, int *min, int *max) {
int i;
*min = arr[0];
*max = arr[0];
for(i = 1; i < size; i++) {
if(arr[i] < *min) *min = arr[i];
if(arr[i] > *max) *max = arr[i];
}
}
// Function that returns both quotient and remainder
void divide(int dividend, int divisor, int *quotient, int *remainder) {
*quotient = dividend / divisor;
*remainder = dividend % divisor;
}
// Function that processes string and returns length and vowel count
void analyzeString(char *str, int *length, int *vowelCount) {
char c;
*length = 0;
*vowelCount = 0;
while(*str != '\0') {
(*length)++;
c = *str;
if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') {
(*vowelCount)++;
}
str++;
}
}
int main() {
int numbers[] = {45, 23, 89, 12, 67, 34, 91, 56};
int size = sizeof(numbers)/sizeof(numbers[0]);
int min, max;
getMinMax(numbers, size, &min, &max);
printf("Array min: %d, max: %d\n", min, max);
int quotient, remainder;
divide(17, 5, "ient, &remainder);
printf("\n17 / 5 = %d remainder %d\n", quotient, remainder);
char str[] = "Hello World Programming";
int len, vowels;
analyzeString(str, &len, &vowels);
printf("\nString: \"%s\"\n", str);
printf("Length: %d, Vowels: %d\n", len, vowels);
return 0;
}