Find student with lowest marks Dry Run in C

Find student with lowest marks is an interactive C dry run visualizer from the Structures Arrays 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.

Find student with lowest marks Program Code

#include <stdio.h>

struct Student {
    int roll;
    char name[40];
    float percentage;
};

int findLowest(struct Student s[], int n) {
    int minIndex = 0;
    for(int i = 1; i < n; i++) {
        if(s[i].percentage < s[minIndex].percentage) {
            minIndex = i;
        }
    }
    return minIndex;
}

int main() {
    struct Student students[50];
    int n;
    
    printf("Enter number of students: ");
    scanf("%d", &n);
    
    for(int i = 0; i < n; i++) {
        printf("\nStudent %d:\n", i+1);
        printf("Roll: "); scanf("%d", &students[i].roll);
        printf("Name: "); scanf(" %[^\n]", students[i].name);
        printf("Percentage: "); scanf("%f", &students[i].percentage);
    }
    
    int lowestIndex = findLowest(students, n);
    
    printf("\n========== LOWEST SCORER ==========\n");
    printf("Roll No: %d\n", students[lowestIndex].roll);
    printf("Name: %s\n", students[lowestIndex].name);
    printf("Percentage: %.2f%%\n", students[lowestIndex].percentage);
    
    return 0;
}

View the complete Structures Arrays programs page.

Program Console Find student with lowest marks Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.