LogiQuest
Back to Arrays
3

What will be the output of the program?

#include <stdio.h>

int main(void) {
    int a[5] = {5, 3, 9, 1, 7}, i, max = a[0];
    for (i = 1; i < 5; i++) if (a[i] > max) max = a[i];
    printf("%d\n", max);
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.