Pass by Reference v/s Pass by value
June 12, 2012
Reversing a Singly Linked list
June 12, 2012

C program output

What will be the output of the below C language program:

int main()
{
    enum os {windows, unix, mac};
    enum furnitures {doors, windows, table, chair, bed};
    for(int i=doors; i<bed; i++)
    printf("%d ", i);
    return 0;
}

Solution:

Result: ERROR !

In the given program, enumeration constant windows is defined twice, once in os and then in furnitures. An enumeration constant can only be defined once.

It cannot be repeated across enumerations.

Leave a Reply

Your email address will not be published. Required fields are marked *