/*AN IMPLEMENTATION TO SHOW BEHAVIOUR OF OPERATORS WHEN USED TOGETHER WITH NO BRACKETS..*/
#include<stdio.h>
int main()
{
{
int x,y,z;
x=2,y=1,z=0;//INITIALISE THE VALUES//
x=x&&y||z;//priority of logical and is more than logical or...so..2&&1=true means 1 is 1st done..//then onthis 1 is made ored with z....1||0=1 ..so output will be 1 printed
printf("%d\n",x);//x=1 is printed as output was...
printf("%d\n",x||!y&&z);//priority of ! is more of all..so..!y=THIS IS LOGICAL NOT..MEANS 1 IS +VE VALUE..SO !y=0...y would either be +ve or -ve value...!y=0 ...& !0 is always 1...//
//!y=0 here....now x||0&&z..now priority of logical && is more than logical ||...so 0&&z is done 1st=0&&0=FALSE MEANS 0....EITHER ONE OF THE VALUE BETWEEN 2 IS 0 IN DOING LOGICAL AND..WHOLE CONDITION WOULD BE FALSE...SO x||0= TRUE..MEANS 1 ...x=2.....
//0000 0010 || 0000 0000=true...1 will be printed...
}
float z;
int y;
int x=y=1;//VALUES ARE INITIALISED again..//z is float
z=x++ -1;//1st it will do operation & then ++ments...means x=1 so 1-1=0 so value of z=0..& after that x will become 2...//
printf("%d\n",z);//z=0 is printed..
printf("%d\n",x);//x=2 is printed
z=-x++ + ++y;//x=2 already & y=1 so 1st operation of post ++mented value & then ++ment
//IN PREINCREMENT .../1ST ++MENT & THEN OPERATION...MEANS -2+2=0 ...so z=0//x will remain 2..& ++y=2....now after operation x will also ++ment ..//
printf("%d%d\n",x,z);//x=3 z=0 will printed
z=x/x++;//EITHER ITS PRE++MENT OR POST++MENT ...IT WILL ++MENT 1ST & THEN DO DIVISION...SEE <MAN OPERATOR>
//SO x++=4.....so x=4...4/4=1...ans should be 1 i..if u have printed float value with %f...if u had printed with %d..then every float value with %d ..prints 0...//always//