Knowledge is Power.

  • Who you are ?

    Working on machines without understanding them ? Then you should be here..

  • Where you are ?

    Geographical location should not become a barrier to Share our knowledge.

  • What do you do ?

    Puzzles and Interview question are intended to be discussed here.

    Wednesday, February 24, 2010

    Q 6.)
    #include
    int main()
    {
    int a=3, b = 5;

    printf(&"Ya!Hello! how is this? %s\n"[a], &b["junk/super"]);
    printf(&"WHAT%c%c%c %c%c %c !\n"[a], 1["this"],
    2["beauty"],0["tool"],0["is"],3["sensitive"],4["CCCCCC"]);
    return 0;
    }


    is this a valid c program....



    Q 7.)
    The following C program segfaults of IA-64, but works fine on IA-32.

    int main()
    { int* p;
    p = (int*)malloc(sizeof(int));
    *p = 10;
    return 0; }


    Why does it happen so?



    Q 8.)

    #include
    #define f(a,b) a##b
    #define g(a) #a
    #define h(a) g(a)

    int main()
    {
    printf("%s\n",h(f(1,2)));
    printf("%s\n",g(f(1,2)));
    return 0;
    }

    guess the output...




    Q 9.)

    #include
    int main()
    {
    int a = 1,2;
    printf("a : %d\n",a);
    return 0;
    }


    is this valid C program..
    if yes..
    what is the output of this C program..
    say it without executing..
    silly question..



    Q 10.)
    if this happens that u have to multiply a number by 7 without using * sign..
    which of the answer u will choose..
    justify ur answer....

    x = (x<<3)-x;

    or

    x=(x<<2) + (x<<1) + x

    0 comments:

    Post a Comment