LogiQuest
Back to Arrays
14

What will be the output of the program?

#include <stdio.h>

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

Discussion (0)

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

Log in to join the discussion.