Q:

Predict the output of below code:

0

Predict the output of below code:

#include<stdio.h>

int main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
    return 0;
}

  1. 2,5,15
  2. 3, 2, 15
  3. 1,2,5
  4. 12,15,1

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Correct Answer:

3, 2, 15

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

What is the value of a[4]?... >>
<< Syntax of accessing the seventh element...