Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   output of expression (http://www.go4expert.com/forums/output-of-expression-t25004/)

prateeek12 16Feb2011 18:44

output of expression
 
what will be the output of the expression -:
x=4+2%-8

shabbir 16Feb2011 20:06

Re: output of expression
 
Apply BODMAS

lionaneesh 17Feb2011 01:12

Re: output of expression
 
Quote:

Originally Posted by prateeek12 (Post 79415)
what will be the output of the expression -:
x=4+2%-8

Use a C Program or simply search on google..

xpi0t0s 18Feb2011 15:43

Re: output of expression
 
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;
}


lionaneesh 18Feb2011 18:29

Re: output of expression
 
Quote:

Originally Posted by xpi0t0s (Post 79520)
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;
}


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...


All times are GMT +5.5. The time now is 21:16.