Tuesday 11 July 2017

INTERESTING FACT ON C


Below is one of the interesting facts about C programming:

1) The case labels of a switch statement can occur inside if-else statement

#include

int main()
{
    int a = 2, b = 2;
    switch(a)
    {
    case 1:
        ;

        if (b==5)
        {
        case 2:
            printf("GeeksforGeeks");
        }
    else case 3:
    {

    }
    }
}
Run on IDE
Output :GeeksforGeeks

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Nice and helpful..
    learn C programming from basics with lot of examples....
    ⬇️⬇️⬇️
    Loops in C examples
    C pattern programming examples
    C Arrays examples
    if-else in C with examples
    Strings in C with examples

    and many more..

    ReplyDelete