brain teaser

main()
{
char thought[2][30]={"Don't walk infront me..","i am not follow"};
printf("%c%c",*(thought[0]9),*(*(thought 0)5));
}
What will be the output of this code???

Replies

  • anandkumarjha
    anandkumarjha
    what will be the output of the following codes any why????please explain....
    #include
    #include
    void main()
    {
    printf("%d",printf("%d %d",2,2)& printf("%d %d",2,2));
    getch();
    }




    #include
    #include
    void main()
    {
    printf("%d",printf("%d %d",2,2)& printf("%d %d",2,2));
    getch();
    }
    although thay look like same but they different from each other
  • sam_from_hell
    sam_from_hell
    anandkumarjha
    main()
    {
    char thought[2][30]={"Don't walk infront me..","i am not follow"};
    printf("%c%c",*(thought[0]9),*(*(thought 0)5));
    }
    What will be the output of this code???
    Its throwing up a error "Expected ')' before numeric constant"
  • silverscorpion
    silverscorpion
    anandkumarjha
    what will be the output of the following codes any why????please explain....
    #include
    #include
    void main()
    {
    printf("%d",printf("%d %d",2,2)& printf("%d %d",2,2));
    getch();
    }




    #include
    #include
    void main()
    {
    printf("%d",printf("%d %d",2,2)& printf("%d %d",2,2));
    getch();
    }
    although thay look like same but they different from each other
    I dont see any difference between the first and the second.. I think both are one and the same..

    Anyhow, for the first program, the output is,

    2 2 2 2 1

    There are 2 printf statements inside the main printf statement.. printf statement returns the number of characters it has sent to the output buffer..
    So, both the inner printf's will return 2. It becomes '2 & 2' which is 1. So, 1 is printed last..

You are reading an archived discussion.

Related Posts

People behind Facebook surely know how to be in news all the time. 😎 Many reporters and news persons got an invite to a press event at Facebook HQ this...
Electronic Arts may have removed the Taliban from the multi player portion of its forthcoming "Medal of Honor" game, but the publishing company wants gamers and the public at large...
Satoshi Yanagisawa has developed “Cyclus“, See this Official News at Website here: Cyclus Spring driven personal electricity generator on the Behance Network It is a concept for a wind-up USB...
IRDA i.e. Insurance Regulatory & Development Authority in India has shortlisted Indian IT giants, including Tata Consultancy Services (TCS), Infosys and Wipro, for financial bidding to implement its enterprise resource...
I was discussing with a Senior in College (2 weeks back) about her new project ideas, when we talked about something that would be useful to search small items like...