CrazyEngineers
  • C code output ?

    Sachin Jain

    Sachin Jain

    @sachin-0wuUmc
    Updated: Oct 24, 2024
    Views: 1.2K
    Hii
    Can anyone please explain me the output of this code

    int main()
    {
    int i=0;
    while(+(+i--)!=0)
    i -= i++;
    printf("%d",i);
    getchar();
    return 0;
    }
    I found it at :-
    #-Link-Snipped-#
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Varsha0802

    MemberDec 24, 2010

    -32768, I guess, because the loop will not run. Tell me if I am correct or not.
    Are you sure? This action cannot be undone.
    Cancel
  • deepasri

    MemberDec 24, 2010

    output : -1

    in while loop i variable get -1 values then it is true
    next statment balance the value as i = -1
    then print -1 value.
    Are you sure? This action cannot be undone.
    Cancel
  • Sachin Jain

    MemberDec 24, 2010

    @deepsari,
    You are right its output is -1
    Hey, Can you please explain in some steps...
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register