Q:

Predict the output of below code:

0

Predict the output of below code:

#include<stdio.h>

int main()
{
    int arr[5], i=0;
    while(i<5)
        arr[i]=++i;

    for(i=0; i<5; i++)
        printf("%d, ", arr[i]);

    return 0;
}

  1. 1,2,3,4
  2. Garbage value, 1, 2, 3, 4,
  3. 2,4
  4. none of these

All Answers

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

Correct Answer:

Garbage value, 1, 2, 3, 4,

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

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now