1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

output of expression

Discussion in 'C' started by prateeek12, Feb 16, 2011.

  1. prateeek12

    prateeek12 New Member

    Joined:
    Feb 16, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    what will be the output of the expression -:
    x=4+2%-8
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Apply BODMAS
     
  3. lionaneesh

    lionaneesh Active Member

    Joined:
    Mar 21, 2010
    Messages:
    848
    Likes Received:
    224
    Trophy Points:
    43
    Occupation:
    Student
    Location:
    India
    Use a C Program or simply search on google..
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    What do you think it will be?
    What do you get if you run it in a C program?
    Why do you think that asking here is easier and quicker than writing a C program to test it?
    Code:
    int main()
    {
      int test=4+2%-8;
      printf("%d\n",test);
      return 0;
    }
    
     
  5. lionaneesh

    lionaneesh Active Member

    Joined:
    Mar 21, 2010
    Messages:
    848
    Likes Received:
    224
    Trophy Points:
    43
    Occupation:
    Student
    Location:
    India
    Same is my question..
    I want every-body to understand that simple problems can be solved by ourselves only ... we dont need it to post a new thread on a forum for such easy solutions..

    As Einstein Said :-


    I thanks all those who dint helped me because that's why i did it my self!!


    Hope you understand...
     

Share This Page